ubc-vision / COTR

Code release for "COTR: Correspondence Transformer for Matching Across Images"(ICCV 2021)
Apache License 2.0
460 stars 58 forks source link

find the coordinates of the corresponding point (x', y') on another picture. #39

Closed lllllialois closed 2 years ago

lllllialois commented 2 years ago

Thank you for the outstanding work you do. I would like to ask if it is possible to enter the coordinates of a point (x, y) and find the coordinates of the corresponding point (x', y') on another picture.

jiangwei221 commented 2 years ago

Yes, it is possible. You can check the script: https://github.com/ubc-vision/COTR/blob/master/demo_homography.py In this script we manually input the coordinates of 4 corners of a paint, and find corresponding points in the other image.

lllllialois commented 2 years ago

Thank you very much for your prompt answer, I have tried your suggestion and was able to find the coordinates of the corresponding feature points. Also, can cotr be used for matches with large deformations? For example, a photo of the same person with five fingers open and a photo of the same person with five fingers together, or a photo of a different person with the same five fingers open.

lllllialois commented 2 years ago

Yes, it is possible. You can check the script: https://github.com/ubc-vision/COTR/blob/master/demo_homography.py In this script we manually input the coordinates of 4 corners of a paint, and find corresponding points in the other image.

I tried, but when I specified a point and tried to find its counterpart, I entered the fixed image coordinates and the resulting content of the corresponding point coordinates did not match the original image, it seemed to just move the fixed image coordinate set uniformly to the floating image.

jiangwei221 commented 2 years ago

Maybe the images you tested are too difficult for COTR to work, I.e too much deformation. Can you share some screenshots of your test images?

lllllialois commented 2 years ago

Maybe the images you tested are too difficult for COTR to work, I.e too much deformation. Can you share some screenshots of your test images?

I tried it again this morning and replaced the function 'cotr_corr_multiscale_with_cycle_consistency' with 'cotr_corr_multiscale ' and it worked a little better. When using 'cotr_corr_multiscale_with_cycle_consistency' I enter five coordinates and end up with only one set of matches, using 'cotr_corr_multiscale ', I was able to find all of them, although there were some wrong matches in there. findxyhand12 findxy12 The image above is generated using the function 'cotr_corr_multiscale_with_cycle_consistency' and the image below is generated using 'cotr_corr_multiscale'. I also tried matching photos of different hands and the results are shown below. differentpeoplezijifind From the naked eye, the effect seems to be OK.

jiangwei221 commented 2 years ago

Yes, the one with cycle consistency will filter out matches that are not trustworthy, that’s why you only obtained one match in the end.

lllllialois commented 2 years ago

thanks for ur answer!

lllllialois commented 2 years ago

Although it doesn't feel quite possible, I'd like to ask if you think cotr can be used for point cloud alignment.

klinic commented 1 year ago

Maybe the images you tested are too difficult for COTR to work, I.e too much deformation. Can you share some screenshots of your test images?

I tried it again this morning and replaced the function 'cotr_corr_multiscale_with_cycle_consistency' with 'cotr_corr_multiscale ' and it worked a little better. When using 'cotr_corr_multiscale_with_cycle_consistency' I enter five coordinates and end up with only one set of matches, using 'cotr_corr_multiscale ', I was able to find all of them, although there were some wrong matches in there. findxyhand12 findxy12 The image above is generated using the function 'cotr_corr_multiscale_with_cycle_consistency' and the image below is generated using 'cotr_corr_multiscale'. I also tried matching photos of different hands and the results are shown below. differentpeoplezijifind From the naked eye, the effect seems to be OK.

Excuse me, do you mean a single pixel or a very small area on the hand. Because I consider that a single pixel has no coordinates of four corners