SIFT描述符在循环中使用时返回OpenCV中的NoneType

2024-04-25 16:58:33 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一些图片存储在Pandas数据框中,我试图计算它们的SIFT特征,如下所示:

for image in df['images']:
    sift = cv2.xfeatures2d.SIFT_create()
    (kps, descs) = sift.detectAndCompute(image, None)
    print descs == None
    # Do something with the descriptors

对于特定图像,此循环在循环中运行时为“descs”变量提供“NoneType”。但是,当我一步一步地为该映像运行代码时,它运行时没有任何问题。我不明白原因。在


Tags: 数据inimagenonepandasdffor图片

热门问题