Using DescriptorMatcher with mask and crosscheck

asked 2014-03-26 12:45:27 -0600

jakobwilm gravatar image

Hello Community,

I am implementing a tracking application which extracts SIFT features from a calibrated stereo pair and matches them.

Now, I want the matching to obey the epipolar constraint, and also to increase robustness, I want only "bijective" matches -- i.e. use the crosscheck flag in cv::BFMatcher. Unfortunately, cv::batchDistance() throws an exeption because it does not allow crosscheck and a mask at the same time:

if( crosscheck )
{
    CV_Assert( K == 1 && update == 0 && mask.empty() );

Why can't batchDistance() run with swapped inputs and a transposed mask matrix? I currently have to do this myself:

matcher->match(descriptors1, descriptors0, matches10, mask.t());
matcher->match(descriptors0, descriptors1, matches01, mask);
cvtools::matchingCrossCheck(matches01, matches10, matches);

But I rather didn't because I can't implement this optimally without access to the underlying structures.

Can I post this as a feature request, or is there an alternative way?

Regards, Jakob Technical University of Denmark

edit retag flag offensive close merge delete

Comments

1

Could you add the exact error message?

Moster gravatar imageMoster ( 2014-03-26 13:42:26 -0600 )edit