(OpenCV, MatchesInfo) MatchesInfo includes correlation information between matched images.

After using BestOf2NearestMatcher function,
We can see correlation value between matched images.

MatchesInfo has follow element.

struct CV_EXPORTS MatchesInfo



 MatchesInfo(const MatchesInfo &other);

    const MatchesInfo& operator =(const MatchesInfo &other);

    int src_img_idx, dst_img_idx;       // Images indices (optional)

    std::vector matches;
     std::vector inliers_mask;    // Geometrically consistent matches mask
     int num_inliers;                    // Number of geometrically consistent matches
     Mat H;                              // Estimated homography
     double confidence;                  // Confidence two images are from the same panorama

http://feelmare.blogspot.kr/2013/12/finding-largest-subset-images-that-is.html-> you can see find feature and matching example source.

we can see correlation value from below source code.
printf("pairwise_matches %d \n", pairwise_matches.size() );
 for(int i=0; i < pairwise_matches.size(); ++i)
  printf("%d \n", i );
  printf("%d -> %d \n", pairwise_matches[i].src_img_idx, pairwise_matches[i].dst_img_idx );
  printf("num inliers = %d\n", pairwise_matches[i].num_inliers);
  cout << "H " << pairwise_matches[i].H << endl;
  printf("confidence = %lf \n", pairwise_matches[i].confidence );


In here, confidence value is calculate by

// These coeffs are from paper M. Brown and D. Lowe. "Automatic Panoramic Image Stitching
    // using Invariant Features"
    matches_info.confidence = matches_info.num_inliers / (8 + 0.3 * matches_info.matches.size());

    // Set zero confidence to remove matches between too close images, as they don't provide
    // additional information anyway. The threshold was set experimentally.
    matches_info.confidence = matches_info.confidence > 3. ? 0. : matches_info.confidence;

If cofidenc value is lower than 1, we think the images are not relative image(no overlap image).

No comments:

Post a Comment