print('Unclear system specification') sys.exit(1) if data == 'dic': def_image = cv2.imread(dic_name, -1) # Read in image 'as is' elif data == 'psfdi': def_image = cv2.imread(psfdi_name, -1) # Read in image 'as is' else: print('Unclear image data type') sys.exit(1) # Translate image F = np.array([[F11, F12], [F21, F22]]) # get def image interp coefficients def_coeff = numerics.image_interp_bicubic(def_image) # Create sub images (def) def_sub_image = def_image[:450, :450] # Create ref sub image ref_sub_image = np.zeros(def_sub_image.shape) i = 0 j = 0 for row in range(0, 450): for col in range(0, 450): # New pt (x, y) pt = F @ np.array([col, row]) + np.array([dx, dy]) val = numerics.eval_interp_bicubic(def_coeff, pt[0], pt[1], def_image.shape) ref_sub_image[i, j] = val
rigid_set = np.zeros((numsteps, 2)) F_set[0, :, :] = F rigid_set[0, :] = rigid temp_F = F temp_rigid = rigid for i in range(1, numsteps): temp_F = temp_F @ F temp_rigid = temp_rigid + rigid F_set[i, :, :] = temp_F rigid_set[i, :] = temp_rigid ''' # get def image interp coefficients def_coeff = numerics.image_interp_bicubic(def_image) # Create ref sub image and coords ref_images = np.zeros((numsteps, ) + def_image.shape) step_ctr = list(range(0, numsteps)) step_ctr.reverse() for step in range(0, numsteps): index = step_ctr[step] i = 0 j = 0 for row in range(0, 450): for col in range(0, 450): # New pt (x, y) pt = F @ np.array([col, row]) + rigid if step == 0: