MATLAB | RGB image representation
RGB image can be viewed as three different images(a red scale image, a green scale image and a blue scale image) stacked on top of each other, and when fed into the red, green and blue inputs of a color monitor, it produces a color image on the screen.
- RGB color model is the model in which Red, Blue, and Green colors are blended together to form an array of colors
- In this article, we will learn the concept of extraction of RGB components from an image and the calculation of RGB values pixels on the MATLAB interface.
- An RGB image is sometimes referred to as a true color image as the precision with which a real-life image can be replicated has led to the nickname “true color image.”
Advantages of RGB color model
- No transformations are required to display data on the screen.
- It is considered the base color space for various applications
- It is a computationally practical system.
- With the help of additive property, it is used in video displays
- This model is very easy to implement
- Some of its uses are as follows:
- In the displays
- In the cameras
- In the scanner
- In MATLAB, an RGB image is basically a M*N*3 array of color pixel, where each color pixel is associated with three values which correspond to red, blue and green color component of RGB image at a specified spatial location.
- the color of any pixel is determined by the combination of the red, green, and blue intensities stored in each color plane at the pixel’s location. Here each color plane is a M*N array.
- Let an RGB image is of class ‘uint8’, i.e. the range of values a color component plane can have is (2 raise to the power 8) which results to [0 – 255 ] ( a total of 256 shades of that color).
So, each individual color plane of An RGB image is capable of showing 256 shade of that color.
So total number of combination of color that can be represented in an RGB image is 256 X 256 X 256 = 16777216, approximately 16 million.
- As can be seen in the above image, Pixel(A) has value (255, 0, 255) and is determined by the combination of intensities stored in the red color plane, green color plane and blue color plane respectively.
- Similarly, pixel(B) has value (127, 255, 0) and is determined in the same manner as pixel(A).
Color planes of RGB image:
Consider an RGB image array ‘I’ then, One has to add the address of the image in MATLAB drive and then copy the address in the respective code, then only one can use the image.
- I(:, :, 1) represents the Red color plane of the RGB image
- I(:, :, 2) represents the Green color plane of the RGB image
- I(:, :, 3) represents the Blue color plane of the RGB image
One more method
- There present an image viewer section in the apps section of MATLAB interface there we can analyze or inspect all the characteristics of the image.
- To reach there Go to Apps section then go to image processing and computer vision section there you will get Image viewer
- One can open any image and inspect its characteristics we will do the same thing by checking the RGB components of an image.
Output of the inspections
My Personal Notes arrow_drop_up
Please Login to comment...