opencv二值化操作 opencv error: (-209)

error: (-209) The operation is neither 'array op array' (where arrays have the same size and type),
              nor 'array op scalar', nor 'scalar op array' in function cv::binary_op

解决办法:将输入数据转换为np.uint8类型,如

img = img.astype(np.uint8)
发布了38 篇原创文章 · 获赞 98 · 访问量 36万+

猜你喜欢

转载自blog.csdn.net/xijuezhu8128/article/details/88555424