Page 36 - PowerPoint Presentation
P. 36
Splitting and Merging Image Channels
• # split channels
• b,g,r=cv2.split(input_image)
• # show one of the channels (this is red - see that the sky is kind of
dark. try changing it to b)
• plt.imshow(b, cmap='gray')
• merged=cv2.merge([r,g,b])
• # merge takes an array of single channel matrices
• plt.imshow(merged)

