cv2.findContours

Layout of the output array image is incompatible with cv::Mat (step[ndims-1] != elemsize or step[1] != elemsize*nchannels)

解决办法:

1. copy of original array   

    image=image.copy()

2.数组可能不连续,那就使他连续:

image = np.ascontiguousarray(image, dtype=np.uint8)

 

猜你喜欢

转载自www.cnblogs.com/huhuai/p/10125874.html