From: Nandish on

Dear one,

i am working with grayscale image.

example
F = imread(filename.jpg);
I = rgb2gray(F);
image(I); % this time it shows grayscale image with xtick and ytick
figure, handle = image(I); % at this time it show color image with xtick and ytick

why there is change in color..from gray to rgb?

Also when i am using the following statement alone
H = image(I);
It show me some scalar value instead of matrix form in Workspace.. what is that?

Thanks
From: ImageAnalyst on
Nandish:
The only way it could show a monochrome image as color is if you
applied a colormap, which you didn't mention. However I suspect this
is not your actual code (because your imread would not work unless jpg
was a string field off of a structure called filename) so you might
have neglected to post something.

Just sending the handle to a variable H would not affect whether the
image showed "color image with xtick and ytick" or a "scalar value."
If I is a scalar, you must have made it that way somehow.