Basics of ORB | Towards AI
Oriented FAST and Rotated BRIEF (ORB)
Learn how to use the fastest and efficient alternative to SIFT
So first let’s get a general idea about what it does & how it works. Then we’ll see both of these algorithms separately i.e. FAST and BRIEF. Fast and brief, are a feature detection in a vector creation algorithm respectively.
ORB, starts by finding special regions in an image called key points. Key points are the highly-distinctive locations in an image. For example, the edges of an image (where the brightness varies i.e where the pixel values change sharply ).
How does ORB work?
- First, it uses FAST to find key points, then applies a Harris corner measure to find top N points among them. FAST stands for Features from Accelerated Segments Test, and it quickly selects key points by comparing the brightness levels in a given pixel area.
- BRIEF, to create feature vectors.
Feature Detection using FAST( Features from Accelerated Segments Test):
- Select a pixel p in the image which is to be identified as an interesting point or not. Let its intensity be I.
- Select the appropriate threshold value t.
- Consider a circle of 16 pixels around the pixel under test. (See the image below).
pixel ‘p’ is selected as a key point if there are at least a pair of consecutive pixels that are either brighter or darker than p. This optimization reduces the time required to search an entire image for key points by a factor of four.
So, the key points found by FAST, give us information about the location of an object defining edges in an image.
One problem is that FAST doesn’t compute the orientation. So what about rotation invariance? The answer is: Machine Learning a Corner Detector and Non-maximal Suppression.
BRIEF (Binary Robust Independent Elementary Features):
The second part of the ORB algorithm is to take the key points found by the FAST algorithm and turn those into feature vectors that together can represent an object. To create feature vectors, ORB uses a BRIEF algorithm.
It basically creates binary feature vectors from a set of key points. As we already know a binary feature vector, is also known as a binary descriptor, which is just a feature vector that contains only ones and zeros.
BRIEF provides a shortcut to find the binary strings directly. It takes a smoothened image patch and selects a set nd(x,y) location pairs in a unique way and then pixel intensity comparisons are done on these location pairs. For mathematical aspects, you can look up: OpenCV documentation
In short, BRIEF is a faster method feature descriptor calculation and matching. It also provides a high recognition rate unless there is a large in-plane rotation.
Check out its implementation code on GitHub.