-1

I did image registration between two images (img_source, img_ref) using the following code.

# Find homography
h, mask = cv2.findHomography(points1, points2, cv2.RANSAC)
# Use homography
height, width, channels = im2.shape
im1Reg = cv2.warpPerspective(img_source, h, (width, height))

It works perfectly. Then I want to know the location of some specific point (say point (x,y) on img_source) on registered_image (say, (x,y) on im1Reg). Following the explanation of warPerspective on the OpenCV website, I apply the following equation:

x=(M11x0+M12y0+M13)/(M31x0+M32y0+M33) y=(M21x0+M22y0+M23)/(M31x0+M32y0+M33)

where M_{i,j} is the entry of the transformation matrix h.

However, the resulting (x,y) is incorrect (mismatching). Any suggestions here?

Thanks!

  • Can you share some data with how it is mismatching? – Edeki Okoh Jun 12 '19 at 23:21
  • Sure, here's the image when I overlaying the transformed location on the registered image. Each point is expected to be overlaid on a car. [link]: https://drive.google.com/open?id=1_VCJ-9fAOq7WhW7a5RpznMC6R-aFpj-h – Long Shangguan Jun 13 '19 at 18:33

1 Answers1

0

Here's the image when I overlaying the transformed location on the registered image. Each point is expected to be overlaid on a car. [link]: https://drive.google.com/open?id=1_VCJ-9fAOq7WhW7a5RpznMC6R-aFpj-h