Skip to content

Commit

Permalink
fix for getMatches function
Browse files Browse the repository at this point in the history
  • Loading branch information
kalwalt committed Apr 1, 2024
1 parent 9536f62 commit f4ea9ff
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,13 @@ class WebARKitTracker::WebARKitTrackerImpl {
std::vector<std::vector<cv::DMatch>> knnMatches;
_matcher->knnMatch(frameDescr, refDescr, knnMatches, 2);

framePts.clear();
std::vector<cv::Point2f> refPts;
framePoints.clear();

// find the best matches
for (size_t i = 0; i < knnMatches.size(); ++i) {
if (knnMatches[i][0].distance < _nn_match_ratio * knnMatches[i][1].distance) {
framePts.push_back(frameKeyPts[knnMatches[i][0].queryIdx].pt);
refPts.push_back(refKeyPts[knnMatches[i][0].trainIdx].pt);
framePoints.push_back(frameKeyPts[knnMatches[i][0].queryIdx].pt);
refPoints.push_back(refKeyPts[knnMatches[i][0].trainIdx].pt);
}
}
}
Expand Down

0 comments on commit f4ea9ff

Please sign in to comment.