Login  Register

Re: "Grayscale" values for RGB images

Posted by Jeremy Winston-2 on Feb 20, 2007; 2:03pm
URL: http://imagej.273.s1.nabble.com/Grayscale-values-for-RGB-images-tp3700260p3700263.html

Jacqui Ross wrote:
> [...]
> Or should I be using RGB weighting? If so, how should
> this be determined experimentally for the camera?

Find an example of the highest contrast between
stained and unstained, sample and average the
R, G & B pixels from corresponding regions, and
weight the differences.  I.e.,

Ravg,stained = avg of R values from the sampled region
                of the stained image
Ravg,unstained = avg of R values from the corresponding
                  region of the unstained image
Gavg,stained =  "     G  "
Gavg,unstained =  "     G  "
...

Rdif = Ravg,stained - Ravg,unstained
Gdif = Gavg,stained - Gavg,unstained
Bdif = Bavg,stained - Bavg,unstained

Rwt = Rdif / (Rdif + Gdif + Bdif)
Gwt = Gdif / (Rdif + Gdif + Bdif)
Bwt = Bdif / (Rdif + Gdif + Bdif)

V = Rwt*R + Gwt*G + Bwt*B


HTH,
-Jeremy