打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
使用OpenCV进行图像全景拼接
重磅干货,第一时间送达

def detectAndDescribe(image, method=None): """ Compute key points and feature descriptors using an specific method """
assert method is not None, "You need to define a feature detection method. Values are: 'sift', 'surf'"
# detect and extract features from the image if method == 'sift': descriptor = cv2.xfeatures2d.SIFT_create() elif method == 'surf': descriptor = cv2.xfeatures2d.SURF_create() elif method == 'brisk': descriptor = cv2.BRISK_create() elif method == 'orb': descriptor = cv2.ORB_create()
# get keypoints and descriptors (kps, features) = descriptor.detectAndCompute(image, None)
return (kps, features)

使用ORB和汉明距离检测关键点和描述符

使用SIFT检测关键点和描述符

使用SURF检测关键点和描述符

使用BRISK和汉明距离检测关键点和描述符

def createMatcher(method,crossCheck): "Create and return a Matcher Object"
if method == 'sift' or method == 'surf': bf = cv2.BFMatcher(cv2.NORM_L2, crossCheck=crossCheck) elif method == 'orb' or method == 'brisk': bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=crossCheck) return bf

使用KNN和SIFT的定量测试进行功能匹配

在SIFT特征上使用暴力匹配器进行特征匹配

# Apply panorama correctionwidth = trainImg.shape[1] + queryImg.shape[1]height = trainImg.shape[0] + queryImg.shape[0]
result = cv2.warpPerspective(trainImg, H, (width, height))result[0:queryImg.shape[0], 0:queryImg.shape[1]] = queryImg
plt.figure(figsize=(20,10))plt.imshow(result)
plt.axis('off')plt.show()

交流群

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
超详讲解图像拼接/全景图原理和应用 | 附源码
Opencv 关键点和描述符(三)
OpenCV之特征检测器(Feature Detector),描述子提取器(Descriptor Extractor)和描述子匹配器(Descriptor Matcher)
基于深度学习的图像匹配技术一览
【计算机视觉】图像配准(Image Registration)
深入理解Java Class文件格式(七)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服