opencv python ORB特征提取

简单的摘抄,说明ORB多么棒。

Theory:
As an OpenCV enthusiast, the most important thing about the ORB is that it came from “OpenCV Labs”. This algorithm was brought up by Ethan Rublee, Vincent Rabaud, Kurt Konolige and Gary R. Bradski in their paper ORB: An efficient alternative to SIFT or SURF in 2011. As the title says, it is a good alternative to SIFT and SURF in computation cost, matching performance and mainly the patents. Yes, SIFT and SURF are patented and you are supposed to pay them for its use. But ORB is not !!!

code:

import numpy as np
import cv2
from matplotlib import pyplot as plt

img = cv2.imread('1.png', 0)
# print('img')

# Initiate STAR detector
orb = cv2.ORB_create()
print('orb')

# find the keypoints with ORB
kp = orb.detect(img, None)
print('kp')

# compute the descriptors with ORB
kp, des = orb.compute(img, kp)

# draw only keypoints location,not size and orientation
img2 = cv2.drawKeypoints(img, kp, None, color=(0, 255, 0), flags=0)
print('img2')

plt.imshow(img2)
plt.show()

  • 名词解释
    训练图像:感兴趣的目标图像
    查询图像:包含有目标的场景图

    识别的过程,就是为了在查询图像中找到训练图像

  • 算法原理
    一. 流程

    1. 利用FAST找到关键点,根据我的理解,这些关键点会关注角点以及边沿等
    2. 使用BRIEF对关键点的邻域特征进行描述,得到每个关键点的二进制编码特征描述
    3. 通过图像金字塔实现特征的尺度不变性;改进BRIEF,也就是rBRIEF实现旋转不变性

    二. 识别过程

    1. 首先对训练图像与查询图像分别计算ORB特征
    2. 使用匹配函数进行匹配。目的是得到关键点之间的对应关系,方法是通过比较各关键点描述符之间的距离来实现。 这里加粗是因为我一开始没看原理,一直没搞明白的一个地方,主要的问题就是没明白描述符表达的物理意义。简单来讲,就是两个关键点的特征越相似,就越容易配对。

参考

OpenCV ORB (Oriented FAST and Rotated BRIEF)

  • 0
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值