0

Hi , just started programming in MATLAB and I have a question.

Image files can be written as RGB/GRAYSCALE/INDEXED and more types,
from what I saw in MATLAB you can read an image by using imread() function
the only difference is what it returns.

[img,MAP] or img
how do I know which one I have to use for each image?

I do know about the imfinfo function and how to get the ColorType

so it's more of an Image question than MATLAB.

thanks,
Despairy

2
Contributors
2
Replies
5
Views
5 Years
Discussion Span
Last Post by Taywin
0

this is what i have so far

if (strcmp(type,'indexed'))
        [x,MAP]=imread(imgFile);
        img=ind2gray(x,MAP); 
    else
        img=imread(imgFile); %reads the image
        if (strcmp(type,'truecolor'))
            img=rgb2gray(imgGet); 
        end
end

its all inside a try/catch function
and it wont throw anything , so i guess its good, but is it enough?

another thing if i load a jpg image i get another image from the same folder
any explanation? O_o

thanks again

edit: the other thing thing... was my mistake for declaring a global variable , it mixed up things, so only the first question remains

EDIT : having a problem reading TIF images , [x,MAP] & img wont read it appropriately

Edited by Despairy

0

Not so sure what you want to do. Anyway, have you read this Matlab page about reading image? It also talks about tiff image format as well.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.