macro to standardize color across images

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

macro to standardize color across images

kshenoy
Hi,
I am using Image-J to quantify the color spots on fish exposed to different treatments. I used a Nikon D-50 camera, with identical settings for every picture. Also, I placed the same reference card in every picture. To measure the colors, I will be selecting the area of the color patch on the fish to be measured, and get the average R, G and B values. However, I would like to standardize this across all pictures to remove effects of slight variations in light, etc. I found a method to do this on Nabble, but I do not know how to apply a macro for it in Image-J. The following are the steps suggested:


1.    Select a picture to be the reference picture. Select an area on the reference card and measure RGB. These values will be Rref, Gref, Bref.

2.    For each picture to be measured, select an area on the reference card and measure RGB. These values will be Rave, Gave, Bave.

3.    Calculate correction factor for that picture: Rcorr = Rref/Rave, Gcorr = Gref/Gave, Bcorr = Bref/Bave.

4.    Now apply this correction factor to every pixel on the picture to be measured: Rcalib = R*Rcorr, Gcalib = G*Gcorr, Bcalib = B*Bcorr.

5.    Then measure the color patch of interest.

The problem is that I do not know how to code Image-J macros. Can anyone help me with this?

Thanks,
Kay.