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)