dwi dwi - 10 days ago 5
C++ Question

Delete matches in OpenCV (Keypoints and descriptors)

I want to check a scene image against two train images.
For that, I detect features and compute descriptors of both training images.
Before detecting, computing and matching the scene image, I will delete all matches of train1 and train2. Because these matches won't facilitate the matching of the scene image with train1 and train2.

So, I match train1 with train2 and get a vector of the matches with the trainIdx and queryIdx. But how can I delete these matches in the keypoints-vector and the descriptor matrix of train1 and train2?

Best regards,
dwi

dwi dwi
Answer

OK, like Micka suggested, I iterate over all keypoints and descriptors and add all of them, except the matches, in a new vector/matrix. There is no possibility to mark them unnecessary.

Comments