if frame1.shape[3] == 3:
frame1 = rgb2gray(frame1)
if frame2.shape[3] == 3:
frame2 = rgb2gray(frame2)
frame1 = frame1[0, ..., 0]
frame2 = frame2[0, ..., 0]
if frame1.dtype != np.bool:
After Change
assert(frame1.shape == frame2.shape)
T, M, N, C = frame1.shape
assert C == 1, "called with frames having %d channels. Please supply only the luminance channel." % (C,)
// if type bool, then these are edge maps. No need to convert them