7.1章 P146中
源码的12行
threshold=cv2.threshold(gray,140,255,0,gray)
应该为
ret,threshold=cv2.threshold(gray,140,255,0,gray)
否则会报如下错误
Traceback (most recent call last):
File "videoCapture.py", line 14, in
cv2.imshow("threshold_image",threshold)
TypeError: Expected Ptr for argument 'mat'
书中源码建议还是需要实测,确保能正常工作,以免给读者带来困扰。