python opencv 转为灰色图片
# coding:utf-8 import cv2 as cv img = cv.imread("a.jpg", cv.IMREAD_GRAYSCALE) cv.imwrite('grayscale_4.jpg', img) if __name__ == "__main__": pass
# coding:utf-8 import cv2 as cv img = cv.imread("a.jpg", cv.IMREAD_GRAYSCALE) cv.imwrite('grayscale_4.jpg', img) if __name__ == "__main__": pass