def transImg(im_Color, im_Color_ref): im_Gry = clr.sRGB2Gray(im_Color) im_Gry_ref = clr.sRGB2Gray(im_Color_ref) # Perform Image Registration using Gray Images scale, angle, [t0, t1] = getTransParam(im_Gry_ref, im_Gry) # Check Color Images im_Color_transformed = np.zeros_like(im_Color_ref) for k in range(0, 3): im_Color_transformed[:, :, k] = applyTrans(im_Color[:, :, k], scale, angle, t0, t1) return im_Color_transformed
def imCompShow(im0, im1, im2, figNum=1): """Plot images using matplotlib.""" from matplotlib import pyplot im_diff = abs(clr.sRGB2Gray(im1) - clr.sRGB2Gray(im0)) f = pyplot.figure(figNum) pyplot.subplot(221) pyplot.imshow(im0) pyplot.subplot(222) pyplot.imshow(im1) pyplot.subplot(223) pyplot.imshow(im_diff, cmap="coolwarm") pyplot.subplot(224) pyplot.imshow(im2) return f