【发布时间】:2018-07-19 13:23:58
【问题描述】:
我正在使用 cv2 来计算 SIFT 特征。灰度图像的值介于 0 和 1 之间(连续浮点值)。问题是如果我不将类型保存为 uint8,则会出现以下错误:
error: /io/opencv_contrib/modules/xfeatures2d/src/sift.cpp:1121: error: (-5) image is empty or has incorrect depth (!=CV_8U) in function detectAndCompute
保存为uint8后:
kp,des=sift.detectAndCompute(img,None)
plt.imshow(cv2.drawKeypoints(img, kp, out_img.copy()))
plt.show()
我得到一个完整的空白图像。有人可以提出解决方案吗?
【问题讨论】:
标签: image-processing feature-extraction feature-detection sift cv2