Ptr<SIFT> detector = xfeatures2d::SIFT::create();
vector<cv::KeyPoint> key_points_1, key_points_2;
Mat dstImage1, dstImage2;
detector->detectAndCompute(srcImage1, Mat(), key_points_1, dstImage1);
I want to extract a image sift feature; but when i run code above, there is a strange situation; key_points_1.size() != dstImage1.size();
as we all know, descriptor will create and compute by keypoints, so they should have same size. One time I have experience this situation, so I rebuild opencv and opencv_contribute, code will be ok; but after a few days, this bug show again, I am confused. detail: vector<keypoint>& keypoint;
before run out of function detectAndCompute till '}', keypoint.size() = descriptor.size
, it is ok; but when it go back the main function, keypoint.size()
have changed.
WIN7 Visual studio 2017 opencv 3.4.1 opencv_contribute 3.4.1 detail: https://upload.cc/i1/2019/05/14/9Me5hT.jpg
keypoint1.size = 156 ,but descriptor1.size = 224
keypoint2.size = 143 ,but descriptor2.size = 205