Posted by
Harry Parker on
Jan 12, 2006; 2:38am
URL: http://imagej.273.s1.nabble.com/Serial-communication-tp3704088p3704092.html
I've done this kind of white balancing manually in ImageJ before. The technique is relatively straightforward and could be turned into a macro if you need to do it often. Here's how I did it.
A patch is gray or white when the values of the 3 color channels (red, green & blue) are equal. So 1st you need to figure out the factors you need to multiply the lower channels by to make them equal to the brighter channel. Here's what I did.
Find a part of the image that should be gray. It can be bright, but none of the color values of the pixels should be saturated (i.e., equal to 255) or the ratios of the color channels will not be accurate in this area.
To check your selected area for saturation, select the area with the rectangle tool and use the Color Histogram plugin.
If a significant fraction of the pixels in any channel is saturated, chose a darker gray area and repeat step 1.
If the area is unsaturated, note the mean values of the pixels. You will multiply the channels with the lower means by the number that makes their mean equal to the highest mean.
For example, if the red mean is 233.9, the green mean is 207.5 and the blue mean is 176.5, you need to
multiply the pixels in the green channel by 233.9 / 207.5 = 1.127
multiply the pixels in the blue channel by 233.9 / 176.5 = 1.325
Now that we have the conversion factors required, we adjust the color intensities.
Click outside your selection rectangle to select the whole image.
Convert the RGB image into an RGB stack
(Menu: Image->Type->RGB Stack)
Select a channel in the stack that needs multiplying.
Use the menu: Process->Math->Multiply... to multiply the channel by the factor you just calculated. (Answer "No" to the question about processing all 3 slices.)
Repeat last 2 steps for the 2nd weak channel.
Convert boosted image back to RGB
(Menu: Image->Type->RGB Color)
That's all.
Martin du Saire <
[hidden email]> wrote: Thanks, I'll try and get my hand on a copy (I'm actually using
Gimp). Do you think the manual gives an explanation of how the
pixels are processed, or just how to use the eyedropper? I am hoping
to reproduce the correction with ImageJ.
M
At 04:26 PM 1/11/2006, you wrote:
> Martin writes ...
>
>
> > Is there a color correction tool for ImageJ? If not, can
> > someone point me to a source that discusses how to achieve
> > this (a la Photoshop or Gimp). All I have been able to find
> > so far are tutorials on how to use Gimp gray point correction
> > or papers on color constancy. I'm looking for something in
> > between, hopefully.
>
>You can use the "gray" eyedropper with PS. It's in the levels and curves
>dialog boxes. Its use should be described in the PS PDF manual.
>
>HTH ...
--
Harry Parker
Systems Engineer
Imaging Systems Division
Dialog Semiconductor, Inc.
---------------------------------
Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.