Laney
Laney

Reputation: 23

SURF features for colmap reconstruction

I'm detecting and computing surf features on a dataset in python with the function: keypoints, descriptors = cv2.detectAndCompute(images, None). I then match them using a cv2.DescriptorMatcher_BRUTEFORCE matcher. The goal is to import these features and matches to colmap to reconstruct a 3D scene.

I extended the surf features to have 128b. The problem is that colmap expects the features to be in a certain format: https://colmap.github.io/tutorial.html . However, the surf features I extract with python have very small values for X Y SCALE and ORIENTATION. Also some scales are negative, which leads to errors in colmap. Also X and Y should be between 0 and number of pixels, but they are all really small numbers close to 0. All other values are set to 0 on purpose before importing the features to colmap.

Is there a way to convert the python surf descriptors to colmap format or is there something wrong with my descriptors?

I visualized the features in python and they seem to be fine. Below is an example file containing the surf descriptors for one of the images.

Thanks for any help!

surf descriptors example

Upvotes: 1

Views: 567

Answers (1)

Hojun Ji
Hojun Ji

Reputation: 1

Colmap expects the descriptor value to be between 0 and 255. For the SIFT feature descriptor, colmap has a logic to convert the small float value into uint8 value. https://github.com/colmap/colmap/blob/7180b62380e35fea330dde9a325d0c61f0d5111c/src/feature/utils.cc#L65

For the SURF, you should do a similar conversion.

Upvotes: 0

Related Questions