Show matches result error with RootSIFT local features
Closed this issue · 6 comments
Thanks for your work!
I use the colmap gui to visual the matches,and result is right,which means the match process(database.db) is right.But I use the show_matches.py to visual the matches. I get wrong result.
After debugging,I find that some keypoints have negative coordinate values.,which makes me confused.
How can I solve this problem?
Hi, thanks for the feedback! To reproduce the error, are you on master
or dev
branch? Which local feature are you using (SP+LG)?
Thanks for your quick reply! I produce the database.db using the traditional colmap command and want to visualize the matches by show_matches.py.As for branch,I just follow the installation (git clone .....) ,the default is master.
colmap command follows:
## Feature extraction
feat_extracton_cmd = colmap_command + " feature_extractor "\
"--database_path " + args.source_path + "/distorted/database.db \
--image_path " + args.source_path + "/input \
--ImageReader.single_camera 1 \
--ImageReader.camera_model " + args.camera + " \
--SiftExtraction.use_gpu " + str(use_gpu)
## Feature matching
feat_matching_cmd = colmap_command + " exhaustive_matcher \
--database_path " + args.source_path + "/distorted/database.db \
--SiftMatching.use_gpu " + str(use_gpu)
mapper_cmd = (colmap_command + " mapper \
--database_path " + args.source_path + "/distorted/database.db \
--image_path " + args.source_path + "/input \
--output_path " + args.source_path + "/distorted/sparse \
--Mapper.ba_global_function_tolerance=0.000001")
img_undist_cmd = (colmap_command + " image_undistorter \
--image_path " + args.source_path + "/input \
--input_path " + args.source_path + "/distorted/sparse/0 \
--output_path " + args.source_path + "\
--output_type COLMAP")
The reason is that sift keypoints from colmap are not (N_features x 2) but (N_features x 6), so you have to change show_matches.py
like this:
line 55 (image_id, blob_to_array(data, np.float32, (-1, 2)))
-> (image_id, blob_to_array(data, np.float32, (-1, 6)))
line 92 keypoints0 = self.keypoints[id0]
-> keypoints0 = self.keypoints[id0][:,:2]
line 93 keypoints1 = self.keypoints[id1]
-> keypoints1 = self.keypoints[id1][:,:2]
This should solve the problem. When using SuperPoint or other features, you should not encounter the problem
Thanks a lot ! I'll try it right now
Good! Feel free to collaborate to the project, or open an issue if you find any problem