python opencv 二值化 计算白色像素点并计算比例输出可视化

话不多说,源码附上:

# #!/usr/bin/env python
# # -*- coding:utf-8 -*-
# # Author's_name_is_NIKOLA_SS
# #pip install   -i https://pypi.mirrors.ustc.edu.cn/simple/
# #matplotlib.rcParams['font.family'] = 'SimHei'  # 用来正常显示中文
# #plt.rcParams['axes.unicode_minus'] = False  # 用来正常显示负号


import cv2
import numpy as np

if __name__ == "__main__":
    img = cv2.imread(r"W

你可能感兴趣的:(python2021,opencv,python,cv,计算机视觉,图像识别)