1. Home
  2. Docs
  3. Computer Vision
  4. Introduction to OpenCV
  5. Opening Image Files in a ...
  6. Extracting Channels

Extracting Channels

Display the image

To print the array use imshow()

plt.imshow(pic_arr)

Extracting Channels

To extract Red Channel

0 – No red, pure black
255 – Full Red
Each of the three R, G, B channel has a range of these values

To change the color map to “gray”

To print the green channel image

pic_red[:,:,1]
pic_red[:,:,2]

To completely rid of one color

pic_red[:,:,1] = 0

To completely rid of bluecolor

Loading

Views: 3

How can we help?

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments