(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();

 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 );
  printf("---\n");
 }

---

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).

Comments

Popular posts from this blog

(OpenCV Study) Background subtractor MOG, MOG2, GMG example source code (BackgroundSubtractorMOG, BackgroundSubtractorMOG2, BackgroundSubtractorGMG)

OpenCV Stitching example (Stitcher class, Panorama)

Example source code of extract HOG feature from images, save descriptor values to xml file, using opencv (using HOGDescriptor )

Real-time N camera stitching Class.

Optical Flow sample source code using OpenCV

OpenCV Drawing Example, (line, circle, rectangle, ellipse, polyline, fillConvexPoly, putText, drawContours)

Video Stabilization example source code, (using cvFindHomography, cvWarpPerspective functions in openCV)

SICK LMS511 sensor data acquisition interface (source code, C++/MFC)

8 point algorithm (Matlab source code) / The method to get the Fundamental Matrix and the Essential matrix

Image warping (using opencv findHomography, warpPerspective)