0

I am trying to generate "SIFT" descriptor (SIFT is only an example) for some manualy defined landmarks. When I try to do:

siftDetector(grayImage, Mat(), manualLandmarks, descriptors, true);

the result is always 0 (zero) for the descriptors. I have described manualLandmarks as std::vector<cv::KeyPoint>, and I have changed the x and y coordinates for each item in the vector (the size, octave and angle values are not changed).

Is there a way to define manualy the image coordinates and compute the descriptors for that location?

Thanks.

goe
  • 2,272
  • 1
  • 19
  • 34
  • it is possible(x,y,octave are the minimal items to fill) but probably a bad idea. most keypoint detectors are complex things, that involve a whole neighbourhood of pixels. maybe it would need a different feature extractor, too (one that is less specialized on sift keypoints) – berak Sep 09 '14 at 12:47
  • That could be a good idea. Could be HoG a good alternative? – goe Sep 09 '14 at 12:56

1 Answers1

1
cv::Mat I = imread("image.jpg"); // load the image


std::vector<cv::Point2f> inputs;

inputs.push_back(cv::Point(74,114)); // manually defined landmark
inputs.push_back(cv::Point(130,114)); // manually defined landmark 

std::vector<cv::KeyPoint> kp;
for( size_t i = 0; i < inputs.size(); i++ ) {
kp.push_back(cv::KeyPoint(inputs[i], 1.f));
}

cv::Mat descriptors;
cv::SiftFeatureDetector detector;
detector.compute(I, kp, descriptors); // descriptors are the sift descriptors on manually defined landmarks
dreamfuleyes
  • 172
  • 1
  • 3
  • 13