Hello, I am trying to compare two objects between each other, but am actually I am having a god at folowing this.
In the iamges I have uploaded beloew, the first one shows some similarities which is good, but when I run another image throrugh that looks nothing like the each other, I also get these matching lines? Is there something I am missing?
()
Mat imsource2;
Mat imquery2;
imsource_crop.copyTo(imsource2);
imquery.copyTo(imquery2);
Ptr<SURF> detector = SURF::create();
detector->setHessianThreshold(threshHaus);
std::vector<KeyPoint> keypoints_1, keypoints_2;
Mat descriptors_1, descriptors_2;
detector->detect(imsource2, keypoints_1, imsource_mask);
detector->detect(imquery2, keypoints_2, imquery_mask);
detector->compute(imsource2, keypoints_1, descriptors_1);
detector->compute(imquery2, keypoints_2, descriptors_2);
BFMatcher matcher(NORM_L2);
std::vector< DMatch > matches;
matcher.match(descriptors_1, descriptors_2, matches);
Mat img_matches;
drawMatches(imsource2, keypoints_1, imquery, keypoints_2, matches, img_matches);
//-- Show detected matches
imshow("Feature", img_matches);
Thank you!