I have two images:
Here is a link to their corresponding csv (2D numpy) arrays: https://drive.google.com/drive/folders/1rqMjAhZub1b97CcGfcQO-RqbN0-lQ9Ah?usp=sharing
How might I register the left image to the right image?
The two images were acquired using different measurement techniques, and therefore have different artifacts. However, in the corners of both images, you can see four distinct square features. These are the features that I want to use to register the left image to the right image. I have tried to think about how to do this but I keep running into problems.
One problem is the square features are high-intensity in my left image and low-intensity (0) in my right image. Another problem is the left image has a (350x350) pixel resolution and the right image has a (512x512) pixel resolution. I have used registration methods like SIFT and ECC before, but I used to have images with the same resolution, and am not sure if these methods would work in this case.
I wanted to get ideas from the community. I've tried to use opencv3 to get a homography warp matrix:
im_left = stackoverflow_help_left_img.copy()
im_right = stackoverflow_help_right_img.copy()
sz = im_left.shape
# Define the motion model
#warp_mode = cv2.MOTION_TRANSLATION
warp_mode = cv2.MOTION_HOMOGRAPHY
# Define 2x3 or 3x3 matrices and initialize the matrix to identity
if warp_mode == cv2.MOTION_HOMOGRAPHY :
warp_matrix = np.eye(3, 3, dtype=np.float32)
else :
warp_matrix = np.eye(2, 3, dtype=np.float32)
# Specify the number of iterations.
number_of_iterations = 5000;
# Specify the threshold of the increment
# in the correlation coefficient between two iterations
termination_eps = 1e-10;
# Define termination criteria
criteria = (cv2.TERM_CRITERIA_EPS | cv2.TERM_CRITERIA_COUNT, number_of_iterations, termination_eps)
# Run the ECC algorithm. The results are stored in warp_matrix.
#(cc, warp_matrix) = cv2.findTransformECC (im1_gray,im2_gray,warp_matrix, warp_mode, criteria)
(cc, warp_matrix) = cv2.findTransformECC (im_right,im_left,warp_matrix, warp_mode, criteria, None, 1)
But this gives the (rather confusing) output error:
error: OpenCV(3.4.15) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-n37r_tup\opencv\modules\video\src\ecc.cpp:393: error: (-210:Unsupported format or combination of formats) Images must have 8uC1 or 32fC1 type in function 'cv::findTransformECC'
Thanks in advance!

