Login  Register

Re: I need help with calibrating an image using ImageJ

Posted by Rasband, Wayne (NIH/NIMH) [E] on Sep 19, 2012; 5:08pm
URL: http://imagej.273.s1.nabble.com/I-need-help-with-calibrating-an-image-using-ImageJ-tp4999914p5000116.html

On Sep 18, 2012, at 5:55 AM, HaibaraAi wrote:

> Oh i see. But do you know how to adjust the RGB value of the picture? For
> example, the RGB value of the white patch in the ColorChecker chart in the
> photo is currently, 255, 255, 240 but you want to adjust it so that it would
> match its real RGB value of 243, 243, 242. THank you! :D

You can do this using the changeValues() macro function, which is described at

   http://imagej.nih.gov/ij/developer/macro/functions.html#changeValues

To change 255,255,240 to 243,243,242, use

   changeValues(0xfffff0, 0xfffff0, 0xf3f3f2);

Use an RGB to hex converter, such as the one at

    http://www.javascripter.net/faq/rgbtohex.htm

to get the hex values needed by the changeValues() function.

The ImageJ macro language is described at

    http://imagej.nih.gov/ij/developer/macro/macros.html

-wayne

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html