[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: COLOR_QUAN question



Daniel Peduzzi (peduzzi@mediaone.net) writes:

> My question concerns the R, G, and B arrays returned by the COLOR_QUAN
> function.  I've noticed that I don't receive the same RGB values if I call the function
> multiple times with the same input arguments.  This isn't very noticeable upon visual
> inspection of the resulting images, unless the differences are exaggerated by color map
> operations such as histogram equalization.

Oh, oh. Hold on here. I think we may be fooling ourselves
a bit. First of all, in the examples that matter (Step 1
and Step 3) the first 31 colors are the gray scale colors
of the images. They appear to be identical in both color
tables. (I used my CINDEX program to view the color tables
after I loaded them.) Moreover, the resulting 2D images
only have values between 0 and 31, and *they* are
identical.

   http://www.dfanning.com/programs/cindex.pro

Notice that your differences start *above* the values
that are really used in the images. 

Although I can't really explain the differences that
*don't* matter, I do note that the algorithm is a 
statistical method. To me this suggests some randomization
may be involved to get some kind of "seed" or something.
(I'm making this up, but I bet I'm right.)

Using a histogram equalization will certainly lead
to strange results, because the color tables returned
from COLOR_QUAN are *never* continuous in color. A pixel
value is assigned a particular color, but that color may
be COMPLETELY different from the pixel with an adjacent
value. There is no requirement, I don't think, that the
same value be assigned the same color in two different
instances. Only that the pixel values and the colors 
fairly represent the colors in the 3D image.

> If I include the /MAP_ALL keyword with each call to COLOR_QUAN, the discrepancies
> disappear.  However, the documentation indicates that /MAP_ALL should be used
> only if /GET_TRANSLATION is also present (which I don't think I need.)
> 
> Should I expect to see the differences above, and is it safe to use the /MAP_ALL
> keyword to eliminate those differences?

I really think the differences are a non-issue. Forget about
the MAP_ALL keyword and cheerfully use COLOR_QUAN. :-)

Cheers,

David

-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155