Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

@Mathieu Barnachon i procced like this

MatOfDMatch matches, matches12, matches21; matcher.match( descriptors1, descriptors2, matches12 ); matcher.match( descriptors2, descriptors1, matches21 ); // iterate matches12 DMatch forward = matches12[i]; // error convert from c++ to java DMatch backward = matches21[forward.trainIdx]; if( backward.trainIdx == forward.queryIdx ) matches.push_back( forward ); // error convert from c++ to java get the good matches then draw it Features2d.drawMatches( mGraySubmat, mKeyPoints,img1, keypoints, matches, mIntermediateMat2,GREEN, RED, MATCH_MASK, Features2d.NOT_DRAW_SINGLE_POINTS);

@Mathieu Barnachon i procced like this

 MatOfDMatch matches, matches12, matches21;
    matcher.match( descriptors1, descriptors2, matches12 );
    matcher.match( descriptors2, descriptors1, matches21 );
 // iterate matches12
        DMatch forward = matches12[i];  // error convert from c++ to java
        DMatch backward = matches21[forward.trainIdx]; 
        if( backward.trainIdx == forward.queryIdx ) 
         matches.push_back( forward );  // error convert from c++ to java
    get the good matches  then draw it
     Features2d.drawMatches( mGraySubmat, mKeyPoints,img1, keypoints, matches, mIntermediateMat2,GREEN, RED,  MATCH_MASK, Features2d.NOT_DRAW_SINGLE_POINTS);

Features2d.NOT_DRAW_SINGLE_POINTS);