Image intrinsics during resize & padding
qsisi opened this issue · 5 comments
Have you re-scale the intrinsics while resizing or padding the image?
Take example for ETH3D, looks like the image is resized when loading:
https://github.com/xuelunshen/gim/blob/main/TEST_GIM_LOFTR.sh#L10-L11
https://github.com/xuelunshen/gim/blob/main/datasets/eth3d/eth3d.py#L69-L72
But is the intrinsic K remains unchanged:
https://github.com/xuelunshen/gim/blob/main/datasets/eth3d/eth3d.py#L101-L102
Which is directly used for pose error computation:
https://github.com/xuelunshen/gim/blob/main/tools/metrics.py#L128-L139
Is that a bug or did I just misunderstand some part of the code?
Looking forward to your reply.
We will scale the keypoints back to the coordinate system of the original image size.
See:
https://github.com/xuelunshen/gim/blob/main/datasets/eth3d/eth3d.py#L104-L105
https://github.com/xuelunshen/gim/blob/main/trainer/lightning.py#L169-L170
https://github.com/xuelunshen/gim/blob/main/trainer/lightning.py#L220-L221
Thanks for your clarification.
What about in the LoFTR setting?
https://github.com/xuelunshen/gim/blob/main/trainer/lightning.py#L151
Looks like the scaling operation is not applied correspondingly?
Thanks for your clarification.
You're welcome, thank you for your attention. 🤝 @qsisi