opencv-python——报错解决:error: (-210:Unsupported format or combination of formats) in ‘threshold‘
报错截图报错代码ret,res_th=cv2.threshold(res_m,127,255,cv2.THRESH_BINARY)cv2.imwrite("res_th.jpg",res_th)解决方法图像的格式一定要是np.uint8,而不是!!!!!.astype(np.uint8)转化一下即可解决!不能用.astype("int8")!!!res_m=res_m.astype(np.uint