import cv2


img = cv2.imread("1.jpg")
b, g, r = cv2.split(img)  #分离函数

merged = cv2.merge([b,g,r]) #合并函数


cv2.imshow('image',img)
cv2.imshow("Blue 1", b)
cv2.imshow("Green 1", g)
cv2.imshow("Red 1", r)
cv2.imshow("merged 1", merged)


cv2.waitKey(0)
cv2.destroyAllWindows()