Skip to content
Search

Oriented FAST and rotated BRIEF

lastmod 2025-02-02created 2017-11-0616 edits

Oriented FAST and rotated BRIEF (ORB) is a fast robust local feature detector, first presented by Ethan Rublee et al. in 2011, that can be used in computer vision tasks like object recognition or 3D reconstruction. It is based on the FAST keypoint detector and the visual descriptor BRIEF (Binary Robust Independent Elementary Features). Its aim is to provide a fast and efficient alternative to SIFT.

Step

  1. Find keypoints using Features from accelerated segment test (FAST).
  2. Detect the top N points with Harris corner detection.
  3. Find keypoints at multiple scales using the scale pyramid (Scale-Pyrimid) used in SIFT (Scale-Invariant Feature Transform).
  4. Build vectors that represent the keypoints using the steer BRIEF descriptor.
  5. Match images using multi-probe LSH (Locality Sensetive Hashing).

Implementation Code

ORB example

def draw_diff(img1, img2, ratio=0.8):
    # Initiate SIFT detector
    orb = cv2.ORB_create()

    # find the keypoints and descriptors with SIFT
    kp1, des1 = orb.detectAndCompute(img1, None)
    kp2, des2 = orb.detectAndCompute(img2, None)

    # create BFMatcher object
    bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)

    # Match descriptors.
    matches = bf.match(des1, des2)

    # Sort them in the order of their distance.
    matches = sorted(matches, key=lambda x: x.distance)

    # BFMatcher with default params
    bf = cv2.BFMatcher()
    matches = bf.knnMatch(des1, des2, k=2)

    # Apply ratio test
    good = []
    for m, n in matches:
        if m.distance < ratio * n.distance:
            good.append([m])

    # Draw first 10 matches.
    knn_image = cv2.drawMatchesKnn(img1, kp1, img2, kp2, good, None, flags=2)
    plt.imshow(knn_image)
    plt.show()

See also

Favorite site

Official

References


  1. Datascienceschool.net_-_7eb4b2a440824bb0a8c2c7ce3da7a4e2.ipynb.zip ↩

author Zer0 sitemap