Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to transform new points after the matches were found? #32

Open
thiagoribeirodamotta opened this issue Oct 23, 2024 · 0 comments
Open

Comments

@thiagoribeirodamotta
Copy link

thiagoribeirodamotta commented Oct 23, 2024

Hi there,

First of all, I'd like to thanks for the great contribution! I'm looking forward to keep on trying this out!

The scenario I'm currently working on requires the transformation matrix that takes points placed on Image1 and correctly place them on Image2.

Since I couldn't find where in the code this transformation happens, I just followed the demo.py script and added the following at the end of it:

  src_pts = np.float32(match_kp0).reshape(-1,1,2)
  dst_pts = np.float32(match_kp1).reshape(-1,1,2)
  M, _ = cv.findHomography(src_pts, dst_pts, cv.RANSAC,3.0)

  transformed_points_to_image_2= cv.perspectiveTransform(np.float32(new_points_image_1).reshape(-1,1,2), M)

Would you say this is the correct approach to transform new points from image 1 coordinate space to image 2 coordinate space?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant