OpenCV ORB特征点检测教程:步骤及代码示例
要检测图像ORB特征点,可以使用以下步骤:
- 导入OpenCV库
import cv2
- 读取图像
img = cv2.imread('image.jpg')
- 创建ORB对象
orb = cv2.ORB_create()
- 检测特征点
keypoints = orb.detect(img, None)
- 绘制特征点
img_with_keypoints = cv2.drawKeypoints(img, keypoints, None)
cv2.imshow('ORB keypoints', img_with_keypoints)
cv2.waitKey(0)
完整代码:
import cv2
# 读取图像
img = cv2.imread('image.jpg')
# 创建ORB对象
orb = cv2.ORB_create()
# 检测特征点
keypoints = orb.detect(img, None)
# 绘制特征点
img_with_keypoints = cv2.drawKeypoints(img, keypoints, None)
cv2.imshow('ORB keypoints', img_with_keypoints)
cv2.waitKey(0)
原文地址: https://www.cveoy.top/t/topic/koHe 著作权归作者所有。请勿转载和采集!