Parskatt / DKM

[CVPR 2023] DKM: Dense Kernelized Feature Matching for Geometry Estimation
https://parskatt.github.io/DKM/
Other
378 stars 28 forks source link

the structure and information of 'warp' #29

Closed zzxq2310 closed 1 year ago

zzxq2310 commented 1 year ago

I am performing an image matching test on demo_match.py. What is the structure of the warp obtained in this code ‘warp, certainty = dkm_model.match(im1_path, im2_path, device=device)’, and what is the information stored in it?I want to get the pixel matching relationship of two pictures through ‘warp’, how should I do it?Thank you very much!

Parskatt commented 1 year ago

Hi. Basically it produces a grid (H,W) of matches (x_A,y_A,x_B,y_B) (between image A and B). If we match symmetrically, the grid is (H, 2*W).

Parskatt commented 1 year ago

The matches are produced in the normalized grid [-1,1]x[-1,1]. You can transform this to pixel coordinates by (x+1)W/2 and (y+1)H/2, for whatever H and W you want.

Parskatt commented 1 year ago

See also https://github.com/Parskatt/DKM/blob/main/demo_fundamental.py for how to do stuff.

Parskatt commented 1 year ago

I have now also updated the readme, https://github.com/Parskatt/DKM#readme :)

zzxq2310 commented 1 year ago

I have now also updated the readme, https://github.com/Parskatt/DKM#readme :)

Got it. Thank you very much!