1、
TypeError: Incorrect type of self (must be ‘Feature2D’ or its derivative)错误

在编辑opencv中fast函数:
fast = cv2.FastFeatureDetector()
时候,会出现上面那个错误。要将函数修改为:
fast = cv2.FastFeatureDetector_create()

这个错误的ORB后面也是要加一个_creat()
其他基本也是后面加一个create

2、 后面还出现一个错误:
img2 = cv2.drawKeypoints(img, kp, color=(255,0,0))

TypeError: drawKeypoints() missing required argument ‘outImage’ (pos 3)

因为这边需要一个输出图像,在kp后面还要一个图像。所以需要定义一个gray,函数变成:

img2 = cv2.drawKeypoints(img, kp, gray, color=(255,0,0))

fast函数总体如图:
opencv函数错误TypeError: Incorrect type of self (must be ‘Feature2D‘ or its derivative)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-25
  • 2021-07-05
  • 2021-07-15
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-13
  • 2021-11-17
  • 2021-09-02
  • 2021-06-11
  • 2021-06-14
  • 2022-12-23
相关资源
相似解决方案