图形的合并切分
from imutils import *
image = imread('test.jpg')
image.shape #查看形状
(400, 300, 3)
(R, G, B) = cv2.split(image) #将三通道的数值切分出来
print(R.shape)
print(G.shape)
print(B.shape)
(400, 300)
(400, 300)
(400, 300)
merged = cv2.merge([R,G,B])
show(merged)
cv2.imshow('R',R)
cv2.imshow('G',G)
cv2.imshow('B',B)
cv2.waitKey(0)
cv2.destroyAllWindows()
因为RGB都是单通道颜色,所以在jupter下其显示都是黑白,但可以看出R红色的整体数值小,更偏白,蓝色的整体数值大,更偏黑