mihaidusmanu / d2-net

D2-Net: A Trainable CNN for Joint Description and Detection of Local Features
Other
761 stars 163 forks source link

some correspondence points of the scene_info are outside of the images #75

Closed Hai-Yen closed 3 years ago

Hai-Yen commented 3 years ago

Hello, I am using your scene_info files to get the correspondence point coordinates of the MegaDepth dataset for my own network. During building the dataset in a different way than the D2-Net, I have noticed that some of the 2D-correspondence point coordinates are outside of the actual images. E.g. some 2D-coordinate values are negative or too big. In your code of the D2-Net, there doesn't seem to be an error caused by this. I think this is because in your function 'crop' in 'dataset.py' you only crop within the actual image regardless of whether the point is within the image or not.

Have I overlooked some transformation with the coordinates or why do the points outside of the images exist in the scene_info?

Thank you for your reply!

mihaidusmanu commented 3 years ago

Hello. The keypoints are extracted from the raw images and their locations are updated (in colmap image_undistorted) to be consistent with the undistorted images. Thus, I expect that some points close to the image boundaries in the raw images might end up outside after undistortion. I suggest you to ignore these points as there are probably not a lot of them.

Hai-Yen commented 3 years ago

Thank you for your answer! The points really are very close to the boundaries, so it makes sense to me now. May I ask what the difference between the distorted and the undistorted images is? What is changed and why do they have a different size?

mihaidusmanu commented 3 years ago

The undistorted images have very low (or nonexistent) radial distortion as the parameters estimated during the sparse reconstruction are used to undistort the images. As far as I know, the undistorted images are central crops of the full undistorted images to avoid missing pixels.

Moreover, COLMAP computes depth maps for the undistorted images; the distorted images are thus not aligned with the depth-maps released with MegaDepth

Hai-Yen commented 3 years ago

Thank you very much for the answers!