首页 > 技术文章 > cv2.findContours

huhuai 2018-12-16 10:58 原文

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)

 

推荐阅读