Parskatt / RoMa

[CVPR 2024] RoMa: Robust Dense Feature Matching; RoMa is the robust dense feature matcher capable of estimating pixel-dense warps and reliable certainties for almost any image pair.
https://parskatt.github.io/RoMa/
MIT License
622 stars 51 forks source link

About coordinates normalization #49

Closed nnop closed 1 week ago

nnop commented 5 months ago

Hi, Johan,

I have a question about the coordinates normalization in RoMa.

https://github.com/Parskatt/RoMa/blob/36389eff4089d7b3f4a752c054e8fd0714af7177/roma/models/matcher.py#L565-L572

As you're using colmap coordinate fasion, the left- and right-most pixel should be 0.5 and W-0.5. The current code is converting them to [-1+1/W, 1-1/W]. Shouldn't the conversion be: (2*x-1) / (W-1) - 1? That would make the left- and right-most pixel exactly [-1, 1].

Parskatt commented 3 weeks ago

Hi, sorry for the late reply.

We don't want to make the left and right-most pixel exactly [-1,1] because we are (hopefully) using align_corners=False everywhere. Thus we want them to be [-1 + 1/h, 1-1/h].