OpenCV: Tad bit of Image Processing

While learning computer vision, now and then we will encounter two terms, image-depth and channel. So lets talk about them.

 Image-depth:  It means number of bits allocated for each pixel.

Grayscale Image with image depth of 8Grayscale Image with image depth of 8

In the above image, depth is 8 because each pixel is within value 0, 255, i.e. between 8 bits.

Channel: Pixel value between 0 and 255 can represent only black and white image. So how can we make an image colorful?

As we all know, all colors are formed by R, G, B components. So if we put three image planes each representing corresponding color vector(Red, Green, Blue) we can get the colorful image. Here each vector is a channel.

Here is some properties of the following image.
    •  Image-depth 24 bit(8 bit X 3 channel)
    • 3 channels ( So, this is a color image )
    • The height is 4 pixel
    • The width is 5 pixels
    • The resolution of this image is 4×5.

 

Red, Green, Blue planes of a color image
R, G, B planes of a color image