I'm a beginner in matlab. I have a rgb image and I would like to get the intensity value of every pixels in the image.

1 view (last 30 days)
For grey scale image if r,c,a are row,column,image then [r c a(r,c)] means we are storing coordinates along with intensity value in a row.how should this be modified for rgb images since they have third dimension in addition ?? and if i use rgb2gray then number of pixels are getting reduced, does this mean we are loosing some information???

Accepted Answer

Image Analyst
Image Analyst on 2 Feb 2013
With a true color image, there is a third dimension. That third dimension is either the red value at that row,column location, the green value, or the blue value, depending on if the third dimension index is 1, 2, or 3 respectively.
If you use rgb2gray on an rgb image, then the output of that is a gray scale image and the gray scale image has less information in it than the original color image.

More Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!