![](/img/trans.png)
[英]How to get the positions of the matched points with Brute-Force Matching / SIFT Descriptors
[英]SIFT or SURF - Provide key points and retrieve descriptors
我正在尝试使用OpenCV(2.4.6.0)从我提供的关键点检索描述符。
到目前为止,我还没有成功......
l, des = surf.detectAndCompute(self.gray,None,useProvidedKeypoints = True)
其中l
是一个特征点数组。 我不知道在哪里输入我已经拥有的关键点...
有谁知道如何使用SIFT或SURF进行此操作?
谢谢您的帮助!
这看起来像是detectAndCompute()
的Python绑定问题,因为C ++等价物允许输入关键点。 幸运的是,有一种解决方法。 如果您已经检测到关键点并将它们存储在l
,那么您可以为所提供的关键点创建DescriptorExtractor
对象并计算描述符。
生成FAST关键点然后计算SURF描述符的示例如下:
im = cv2.imread(path_to_image)
fast = cv2.FeatureDetector_create('FAST')
l = fast.detect(im)
surf = cv2.DescriptorExtractor_create('SURF')
l, des = surf.compute(im, l)
这同样适用于SIFT功能。 只需将'SIFT'
作为参数传递给cv2.DescriptorExtractor_create()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.