Hi,
I want to use pre-extracted SIFT features and feed them into COLMAP. I am doing it, because I have additional information about these feature location that I want to use later.
When I import, I got the following log. The match doesn't work
==============================================================================
Feature import
==============================================================================
Processing file [1/72]
Features: 7741
Processing file [2/72]
.
.
.
Processing file [70/72]
Processing file [71/72]
Features: 7245
Processing file [72/72]
Elapsed time: 0.086 [minutes]
==============================================================================
Exhaustive feature matching
==============================================================================
Matching block [1/1, 1/1] in 30.173s
Elapsed time: 0.503 [minutes]
==============================================================================
Loading database
==============================================================================
Loading cameras... 36 in 0.000s
Loading matches... 0 in 0.000s
Loading images... 36 in 0.000s (connected 0)
Building correspondence graph... in 0.000s (ignored 0)
Elapsed time: 0.000 [minutes]
WARNING: No images with matches found in the database.
I saw a similar question on the github page.
My problem is very similar. The post suggested that there might be some thing wrong with the feature vector. To my best, I followed the format mentioned in the tutorials. I have question though
- Sorry, I don't understand this guideline in the tutorial "Note that by convention the upper left corner of an image has coordinate (0, 0) and the center of the upper left most pixel has coordinate (0.5, 0.5). ". Since pixels are floating point coordinates, they will have decimal values. So what is the significance of this guideline? I have used absolute (x,y) coordinates when I created my feature file. I suspect I might have gone wrong here.
I have attached one of the feature files that I created for reference. It would be great if you can spot any problem.
I used the below code to populate the feature files
void unpackOctave(const cv::KeyPoint& kpt, int& octave, int& layer, float& scale)
{
octave = kpt.octave & 255;
layer = (kpt.octave >> 8) & 255;
octave = octave < 128 ? octave : (-128 | octave);
scale = octave >= 0 ? 1.f / (1 << octave) : (float)(1 << -octave);
}
void create_feature_file(std::vector<cv::KeyPoint>& img_keypoints, cv::Mat& img_descriptors, std::string images_path, std::string image_name)
{
if (img_keypoints.size() != img_descriptors.rows)
std::cout << "something wrong" << std::endl;
std::ofstream outfile(images_path + "/images/" + image_name + ".txt");
outfile << img_keypoints.size() << " " << img_descriptors.cols << std::endl;
for (int i = 0; i < img_descriptors.rows; i++) {
float scale;
int octave, layer;
unpackOctave(img_keypoints.at(i), octave, layer, scale);
outfile << img_keypoints.at(i).pt.x << " " << img_keypoints.at(i).pt.y << " " << scale << " " << img_keypoints.at(i).angle;
for (int i = 0; i < img_descriptors.cols; i++) {
float* descVector = img_descriptors.ptr<float>(i); // i - feature index
outfile << " " << (unsigned int)*descVector;
}
outfile << std::endl;
}
outfile.close();
}
Please let me know how to come over this problem.
Thanks and Regards,
Deepak