f



a problem about image reading in MATLAB

greeting all:

Im a freshman to Matlab, so could any1 tell me if MATLAB could reads
the colors on every pixel of a image and returns the values to a
matrix?

thanks in advance.
0
bbbbbh (42)
5/15/2007 6:51:24 PM
comp.soft-sys.matlab 211264 articles. 26 followers. lunamoonmoon (257) is leader. Post Follow

1 Replies
797 Views

Similar Articles

[PageSpeed] 56

In article <ef56fea.-1@webcrossing.raydaftYaTP>,
pangzi  <bbbbbh@hotmail.com> wrote:

>Im a freshman to Matlab, so could any1 tell me if MATLAB could reads
>the colors on every pixel of a image and returns the values to a
>matrix?

Yes. Matlab has three representations for images: "intensity",
"indexed", and "truecolor". Intensity images are grayscale images:
each matrix entry directly reads off the gray luminence.
Indexed images are "pseudocolor" images: each matrix entry
is an index into an N x 3 colortable, so you can find the
pixel colour by indexing the colortable with the matrix value.
Truecolor images, also known in Matlab as RGB images,
are N x M x 3 matrices, in which the colour components for
pixel (I,J) are the matrix at (I,J,:): in this case you just
look up the colour values directly in the image matrix.

The command to read an image is imread(). You may have to
examine the size of the returned matrix in order to determine
what kind of image it is.
-- 
Programming is what happens while you're busy making other plans.
0
roberson2 (8602)
5/15/2007 8:16:15 PM
Reply: