0

In MATLAB R2007b, I can't read a grayscaley image using imread('my_image'). Every image opens as rgb and BitDepth is 24.
What can I do??

Shai
  • 93,148
  • 34
  • 197
  • 325
Muhib
  • 1
  • 1
  • 1

1 Answers1

3

The images are stored as color images with three 8-bits channels. If you want to look at their grayscale representation simply convert them to grayscale after reading them:

>> colorImg = imread('my_image');
>> grayImg = rgb2gray( colorImg );

For more info see rgb2gray.

Shai
  • 93,148
  • 34
  • 197
  • 325
  • Thanks shai. But how can I use imfinfo('....') for grayscale image, as I don't read a grayscale image directly. – Muhib Aug 04 '13 at 15:37
  • @Muhib what info do you need from `imfinfo`? `rgb2gray` does not change the size of the image or its capture time... – Shai Aug 04 '13 at 19:07