<OpenCv-Python>cv.convexityDefects函数返回defects时,调用defects.shape时报错的处理

cv.convexityDefects返回值的shape报错处理

OpenCv有一个凸包缺陷检测的函数cv.convexityDefects,其官方示例如下:

import cv2 as cv
import numpy as np
img = cv.imread('star.jpg')
img_gray = cv.cvtColor(img,cv.COLOR_BGR2GRAY)
ret,thresh = cv.<

你可能感兴趣的:(python,编程世界,opencv,python,计算机视觉)