P3d0r
P3d0r

Reputation: 1099

Fiducial markers - OpenCV - Feature Detection & Matching

Would somebody share their knowledge of OpenCV feature detection and extraction of fiducial markers?

I'm attempting to find a fiducial marker (see image below) (self-created ARTag-style using MS Paint) in a scene.

enter image description here

Using Harris corner detection, I can adequately locate the corners of the marker image. Similarly, using Harris corner detection, I can find most of the corners of the marker in the scene. I then use SIFT to extract descriptors for the marker image and the scene image. Then I've tried both BF and FLANN for feature matching. However, both matching algorithms tend to match the wrong corners together.

Is there something that I can do to improve the accuracy? Or are there other detection methods that would be better appropriate for this application?

Portion of code:

GoodFeaturesToTrackDetector harris_detector(6, 0.15, 10, 3, true);
vector<KeyPoint> keypoints1, keypoints2; 

harris_detector.detect(im1, keypoints1);
harris_detector.detect(im2, keypoints2);

SiftDescriptorExtractor extractor;

Mat descriptors1, descriptors2;

extractor.compute( im1, keypoints1, descriptors1 );
extractor.compute( im2, keypoints2, descriptors2 );

BFMatcher matcher;
//FlannBasedMatcher matcher;
std::vector< DMatch > matches;
matcher.match( descriptors1, descriptors2, matches );

Upvotes: 1

Views: 7165

Answers (1)

cloudtex
cloudtex

Reputation: 157

you can try to use ORB detector, which is a fusion of FAST keypoint detector and BRIEF descriptor. it is fast and better than BRIEF descriptor because the later does not compute the orientation.

  1. you can found a example of orb's usage in samples/cpp/tutorial_code/features2D/AKAZE_tracking or enter link description here
  2. or there is a python project which does the similar task as yours fiducial

Upvotes: 2

Related Questions