Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

image processing

0 views
Skip to first unread message

karthik g

unread,
Feb 11, 2012, 1:30:28 AM2/11/12
to
hi!!1

i encountered a small problem in associating numbers with the colors from the image.

the image consists of (2 X 4) table with 2 rows and 4 columns. Top half is filled is with different colors say (red,green,blue,yellow)

bottom half is filled with different numbers ranging from 1 to 4 say(4,3,2,1)

now, red should be given number 4, green 3 and so on respectively ... How could this be done??? :(

with regards,
karthik

ImageAnalyst

unread,
Feb 11, 2012, 10:42:34 AM2/11/12
to
karthik:

I'm not sure what the difference is. If you have colors, then the
image array is a 3D array where the pixel is a triplet of values for
red, green, and blue, or else it's an indexed image where you've
applied a colormap to assign a color to a single gray value. Either
way, they're numbers. Now, what is the bottom half of the image? You
say they're numbers but like I said, the top half is numbers too.

Lacking a good explanation, all I can say is have a look at rgb2ind(),
ind2rgb(), colormap(), and my color classification demos in my File
Exchange (http://www.mathworks.com/matlabcentral/fileexchange/?
term=authorid%3A31862), or this wikipedia page on color quantization:
http://en.wikipedia.org/wiki/Color_quantization
0 new messages