通道拆散与合成
img = cv2.imread("text.jpg")
导入了一张测试图
h, w = img.shape
b, g, r = cv2.split(img)
s = numpy.zeros(shape=(h, w, 3), dtype=numpy.uint8)
m1 = cv2.merge([b, s, s])
m2 = cv2.merge([s, g, s])
m3 = cv2.merge([s, s, r])
img = cv2.imread("text.jpg")
导入了一张测试图
h, w = img.shape
b, g, r = cv2.split(img)
s = numpy.zeros(shape=(h, w, 3), dtype=numpy.uint8)
m1 = cv2.merge([b, s, s])
m2 = cv2.merge([s, g, s])
m3 = cv2.merge([s, s, r])