Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Opencv python中的findContours()函数中存在类型错误_Python_Opencv - Fatal编程技术网

Opencv python中的findContours()函数中存在类型错误

Opencv python中的findContours()函数中存在类型错误,python,opencv,Python,Opencv,请建议删除此错误的方法 似乎您传递了一张B、G、R图像或。。。查找轮廓,但函数从二进制图像中检索轮廓。 这是一个使用cv2.adaptiveThreshold cv2.error: /build/buildd/opencv-2.4.8+dfsg1/modules/imgproc/src/contours.cpp:196: error: (-210) [Start]FindContours support only 8uC1 and 32sC1 images in function cvStart

请建议删除此错误的方法

似乎您传递了一张
B、G、R
图像或。。。查找轮廓,但函数从二进制图像中检索轮廓。 这是一个使用
cv2.adaptiveThreshold

cv2.error: /build/buildd/opencv-2.4.8+dfsg1/modules/imgproc/src/contours.cpp:196: error: (-210) [Start]FindContours support only 8uC1 and 32sC1 images in function cvStartFindContours  
cv2.error: /build/buildd/opencv-2.4.8+dfsg1/modules/imgproc/src/contours.cpp:196: error: (-210) [Start]FindContours support only 8uC1 and 32sC1 images in function cvStartFindContours  
im = cv2.imread('nnn.png') 
gray = cv2.cvtColor(im,cv2.COLOR_BGR2GRAY)
blur = cv2.GaussianBlur(gray,(5,5),0)
thresh = cv2.adaptiveThreshold(blur,255,1,1,11,2)

contours,hierarchy = cv2.findContours(thresh,cv2.RETR_LIST,cv2.CHAIN_APPROX_SIMPLE)