2.几何变换_切分合并通道

#导入工具包并读入图片

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()

              

posted @ 2019-09-04 16:30  刘文华  阅读(143)  评论(0编辑  收藏  举报