标签:style img code gray str strong div python enc
1、读入灰度图像
可以先读入,再转为灰度图像:
1 img = cv2.imread(img_path) 2 img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
或者直接读为灰度图像:
1 img = cv2.imread(img_path, cv2.IMREAD_GRAYSCALE)
下面这种做法更简单直接。
标签:style img code gray str strong div python enc
原文地址:https://www.cnblogs.com/lxc1910/p/12501797.html