28

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.

Adrian Chitescu
  • 293
  • 1
  • 4
  • 9

1 Answers1

49

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:

  • float descriptors:
    • SIFT
    • SURF
  • uchar descriptors:
    • ORB
    • BRIEF

And corresponding matchers:

  • for float descriptors:
    • FlannBased
    • BruteForce<L2<float> >
    • BruteForce<SL2<float> > //since 2.3.1
    • BruteForce<L1<float> >
  • for uchar descriptors:
    • BruteForce<Hamming>
    • BruteForce<HammingLUT>
    • FlannBased with LSH index //since 2.4.0

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

Andrey Kamaev
  • 29,582
  • 6
  • 94
  • 88
  • 2
    Thanks for your quick response. It is working better now with the BruteForceMatcher, but i still got some unsatisfactory results with some pictures. I am thinking that ORB may be sensitive to rotation/scaling because it uses BRIEF descriptors. Am I right? – Adrian Chitescu Aug 30 '11 at 08:05
  • Anyway, do you know where can i find more about the ORB implementation in opencv? I saw that the ORB class can receive some params(CommonParams) but i don't know how to set them. – Adrian Chitescu Aug 30 '11 at 11:58
  • Actually ORB descriptors are based on BRIEF but not exactly the same (ORB is a shortcut for Oriented BRIEF). So ORB is more sensitive to scale then rotations. Here is a [new comparison](http://computer-vision-talks.com/2011/08/feature-descriptor-comparison-report/) of OpenCV features. And ORB is brand-new algorithm which was added to OpenCV only this summer, so I think that at the moment the only paper explaining ORB is original paper of ORB authors. – Andrey Kamaev Sep 01 '11 at 06:35
  • Also I should note that I don't think ORB has been ported to the python bindings yet. – xamox Jan 20 '12 at 03:59
  • 1
    This may be late in the day, but if you want more information on ORB, the original paper is posted here: http://www.willowgarage.com/sites/default/files/orb_final.pdf It was written by Willow Garage specifically for OpenCV, so I imagine it is fairly useful (although I've not read it - they did have a good poster at ICCV last year!) – n00dle Feb 07 '12 at 16:11
  • @andrey: are you sure you can use `L2` only with SIFT-SURF? Within my project it is working even with `ORB` – dynamic Jun 24 '12 at 22:01
  • @yes123 I'm sure. The result of L2 calculated for ORB is garbage because the implementation can't work with individual bits of ORB descriptor. – Andrey Kamaev Jun 27 '12 at 21:33
  • @AndreyKamaev: Ok I believe you :D. Anyway if you have 1 min please see here: http://chat.stackoverflow.com/rooms/13084/andrey thanks a lot. – dynamic Jun 27 '12 at 21:42
  • What is the difference between HammingLUT and Hamming ? – dynamic Aug 20 '12 at 22:47