Python 2.7 OpenCV:从图像坐标中提取features/descriptors
Python 2.7 OpenCV: Extracting features/descriptors from image coordinates
我在 Python 中使用 OpenCV 从我的图像中提取了几个感兴趣的点(x、y 坐标)(即阈值处理、轮廓查找、力矩)。现在,我想将这些点与参考模式相匹配,以排除错误的检测点。我的方法是将图像点中的features/descriptors与参考图案的features/descriptors进行匹配,但我不知道如何从图像点中提取features/descriptors。
如何在 Python 中使用 OpenCV 从给定坐标中提取 features/descriptors?
也许你应该使用 KeyPoint
import cv2
surf = cv2.SURF() #Should works with another descriptors
customKeyPoints = [cv2.KeyPoint(<your coords, size, angle, etc>),
cv2.KeyPoint(<your coords, size, angle, etc>), ...]
surf.compute(img, customKeyPoints)
#Should return you descriptors from specified points
Similiar question with answer
PS对不起我的英语
我在 Python 中使用 OpenCV 从我的图像中提取了几个感兴趣的点(x、y 坐标)(即阈值处理、轮廓查找、力矩)。现在,我想将这些点与参考模式相匹配,以排除错误的检测点。我的方法是将图像点中的features/descriptors与参考图案的features/descriptors进行匹配,但我不知道如何从图像点中提取features/descriptors。
如何在 Python 中使用 OpenCV 从给定坐标中提取 features/descriptors?
也许你应该使用 KeyPoint
import cv2
surf = cv2.SURF() #Should works with another descriptors
customKeyPoints = [cv2.KeyPoint(<your coords, size, angle, etc>),
cv2.KeyPoint(<your coords, size, angle, etc>), ...]
surf.compute(img, customKeyPoints)
#Should return you descriptors from specified points
Similiar question with answer
PS对不起我的英语