Parskatt / DKM

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

3d point projection, best way to fetch matches #23

Closed drperpen closed 1 year ago

drperpen commented 1 year ago

Hi, I have known camera extrinsics/intrinsics and I like to 3d project the pixels of 2 images matched by DKM. What would be a good point to get the matches between the images? Thanks! Daniel

Parskatt commented 1 year ago

Matching will get you the 2D points, to project into 3D (triangulate) I recommend using e.g. kornia :)

drperpen commented 1 year ago

Thanks for your reply. Yes, but my question was aimed to where do I look to get the matches? In this line:

    # Match
    warp, certainty = dkm_model.match(im1_path, im2_path)

I get the warp, which is a tensor with H, W*2 and 4 values. Those 4 don't look like pixel coordinates to me (matches), although they could be normalized pixel values?

Parskatt commented 1 year ago

Yes, they are normalized in the grid [-1,1]. To convert to pixel coordinates you probably want to do something like (x+1)*H/2.

Parskatt commented 1 year ago

Note that the internal resolution in DKM might not match the original resolution of the image.

drperpen commented 1 year ago

Thank you so much! Yes, I will have in mind DKM's internal resolution when doing the conversions.

Parskatt commented 1 year ago

I'll close for now :)