Improve cvMatchShapes accuracy match in OpenCV

I tried using cvMatchShapes()two marker patterns to match. As you can see on the best way to count the number of "white blocks", etc. In Thresholded IplImage in OpenCV 2.3.0, the source has poor image quality.

I am not satisfied with the results obtained from this function, in most cases it gives incorrect matches. How to use this function (or some suitable function) for effective matching?

Note. My backup solution is to change the marker template to have fairly large / clearly visible shapes. Please follow the link above to see my current marker template.

EDIT

I found this comprehensive comparison of various function detection algorithms implemented in OpenCV. http://computer-vision-talks.com/2011/01/comparison-of-the-opencvs-feature-detection-algorithms-2 . Accordingly, FAST seems like a good choice.

I would give +1 to anyone who can share a good tutorial for implementing FAST (aka STAR / SURF / SIFT) in OpenCV. I can’t think that Google is fast, as in speed :(

+5
source share
1 answer

- FAST. FAST . - . , , .

FAST OpenCV, .

EDIT: , , , FAST:

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <vector>

using namespace std;
using namespace cv;

int main(int argc, char* argv[])
{
    Mat far = imread("far.jpg", 0);
    Mat near = imread("near.jpg", 0);

    Ptr<FeatureDetector> detector = FeatureDetector::create("FAST");

    vector<KeyPoint> farPoints;
    detector->detect(far, farPoints);

    Mat farColor;
    cvtColor(far, farColor, CV_GRAY2BGR);
    drawKeypoints(farColor, farPoints, farColor, Scalar(255, 0, 0), DrawMatchesFlags::DRAW_OVER_OUTIMG);
    imshow("farColor", farColor);
    imwrite("farPoints.jpg", farColor);

    vector<KeyPoint> nearPoints;
    detector->detect(near, nearPoints);

    Mat nearColor;
    cvtColor(near, nearColor, CV_GRAY2BGR);
    drawKeypoints(nearColor, nearPoints, nearColor, Scalar(0, 255, 0), DrawMatchesFlags::DRAW_OVER_OUTIMG);
    imshow("nearColor", nearColor);
    imwrite("nearPoints.jpg", nearColor);

    waitKey();
    return 0;
}

:
near imagefar image

, , , . , . descriptor_extractor_matcher.cpp. .

, !

+3

All Articles