Login  Register

Re: I need help with calibrating an image using ImageJ

Posted by Michael Schmid on Sep 22, 2012; 8:50am
URL: http://imagej.273.s1.nabble.com/I-need-help-with-calibrating-an-image-using-ImageJ-tp4999914p5000161.html

Hi,

first be warned that color calibration is a tricky business, close to
impossible with consumer cameras. Most consumer cameras use a nonlinear
transfer function such as sRGB. Furthermore, pixel value 0 does not
correspond to black. Most consumer cameras increase color saturation
(using 'neutral' color settings may improve this point).
So, you will get only a very rough calibration using the white area of the
color chart.

Assuming that black corresponds to pixel value 0 and that the transfer
curve is linear or a fixed gamma value, what you can do:
- Image>Type>RGB Stack
- For each channel
--- Measure the mean brightness of the white area
--- Process>Math>Multiply by a value calculated as (desired
value)/(measured value of white area). Do it for this channel only, not
for the whole stack.
- Image>Type>RGB Color

You can record these steps with Plugins>Macros>Record and create a macro.
See the ImageJ Macro documentation for details, e.g. the getStatistics
command for getting the mean value in the white area, and how to have a
variable in a command such as run("Multiply...", "value=&myFactor");

Michael
____________________________________________________________________

On Wed, September 19, 2012 12:49, 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
>
>

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