I want to implement a feature-based alignment algorithm using the ORB feature detector and extractor.
So far, I extracted the features using ORB class from OpenCV ORB orb;
orb(gray_image,Mat(),features.keypoints,features.descriptors);
and matched them using the knnMatch function from openCV matcher.knnMatch(features1.descriptors, features2.descriptors, pair_matches,2);
After that I am trying to find a homography using findHomography function, but this function needs at least 4 matches between the image features, and on most of the images i tested I got less than 4.
Has anybody used this feature? Is there any documentation about it, or about the ORB class from OpenCV(the meaning of the ORB constructor parameters)?
P.S. This is my first question. and I can't post more than 2 links. For opencv documentation use this.
Once orb has created a pyramid it uses the fast algorithm to detect keypoints in the image. By detecting keypoints at each level orb is effectively locating key points at a different scale. In this way, ORB is partial scale invariant.
We showed that ORB is the fastest algorithm while SIFT performs the best in the most scenarios. For special case when the angle of rotation is proportional to 90 degrees, ORB and SURF outperforms SIFT and in the noisy images, ORB and SIFT show almost similar performances.
Brute-Force matcher is simple. It takes the descriptor of one feature in first set and is matched with all other features in second set using some distance calculation. And the closest one is returned. For BF matcher, first we have to create the BFMatcher object using cv. BFMatcher().
UPDATE: Now it is in the OpenCV documentation, here: http://opencv.itseez.com/modules/features2d/doc/feature_detection_and_description.html#orb
A detailed description of the algorithm is found here: http://www.willowgarage.com/sites/default/files/orb_final.pdf
It is not mentioned in OpenCV documentation but actually OpenCV has:
Two types of descriptors:
And corresponding matchers:
FlannBased
BruteForce<L2<float> >
BruteForce<SL2<float> >
//since 2.3.1BruteForce<L1<float> >
BruteForce<Hamming>
BruteForce<HammingLUT>
FlannBased
with LSH index //since 2.4.0So you need to modify your code to use for example BruteForce<Hamming>
matcher for ORB descriptors. It is possible to use L2 or L1 distance for matching uchar descriptors but results will be incorrect and findHomography returns unsatisfactory results.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With