opencv3报错:in function cv::pointSetBoundingRect
报错:error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\imgproc\src\shapedescr.cpp:784: error: (-215:Assertion failed) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function 'cv::pointSetBoundingRect'
真实错误位置:
opencv3报错:in function cv::pointSetBoundingRect
是因为OpenCV版本不同,cv2 在3.x版本之后就有这个问题。
要把原来的 contours = contours[0] if imutils.is_cv2() else contours[1]变成contours = contours[1] if imutils.is_cv3() else contours[0]

相关文章:

  • 2021-11-08
  • 2022-12-23
  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2022-01-16
  • 2021-05-23
猜你喜欢
  • 2022-12-23
  • 2021-07-25
  • 2021-09-11
  • 2021-11-01
  • 2021-07-13
  • 2022-12-23
  • 2021-08-20
相关资源
相似解决方案