OpenCV:src is not a numerical tuple

强颜欢笑 提交于 2019-12-05 02:36:33
patel deven

Try:

_,h = cv2.threshold(h, 245, 1, cv2.THRESH_BINARY) #245-255 x>245 y=1
_,s = cv2.threshold(h, 15, 1, cv2.THRESH_BINARY_INV) #1-15,x>15 y=0

cv2.threshold returns two values: http://docs.opencv.org/modules/imgproc/doc/miscellaneous_transformations.html#cv2.threshold

cv2.threshold(src, thresh, maxval, type[, dst]) → retval, dst

You miss the second value dst, omitting that in the expression, you're only getting the retval value which is not an image.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!