Python opencv 调用sift

安装python-opencv: apt-get install python-opencv
import cv2
im = cv2.imread(‘aaa.jpg’)
gray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
#opencv 读取图片默认BGR
sift = cv2.SIFT()
keypoints,descriptors = sift.detectAndCompute(gray,None)
img = cv2.drawKeypoints(gray,keypoints)
cv2.imshow(‘keypoints’,img)
cv2.waitKey(0)
cv2.destroyAllWindows()

method 2

fea_det = cv2.Feature2D_create(“SIFT”)
des_ext = cv2.DescriptorExtrator_create(“SIFT”)
keypoints = fea_det.detect(gray)
kp, des = des_ext.compute(gray,keypoints)

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hao529good/article/details/48711177
文章标签: python opencv sift
个人分类: python opencv
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭