Evaluation of color change in photo / image

Good Moarning,
I’m sorry for my english, but i’m italian and i dont write english wery well.
I’m a Biologist and I work with soil to evaluete the attivity of microorganism. To make this I use a test that consist in a cromatic comparation of the tube containing agar that include an ph indicator that change color in realtion of ph variation.
I have adifferent tubes where I have solution whith noted Ph, and I have make a photo of this tube, at control light. I have one photo every 0.5 ph point change.
When I test the differnt soil I make a photo of tubes test every 8 hours, and I get a series of photo thet rappresent the evoluthion of my test.

Now to calculated the results is necessari for me calculate the ph of the tube test through comparison whith the tube a note ph. Because the manual comparison is not easy and is not objective, thare is a possible metod to evaluate the variation of color through immagej?

Thank for help.
Diego.

@Diego

I think this past post on the forum might have the solution you need:

@oburri’s solution there might be most appropriate in your case. If it’s still not clear… share original image files here for us to better help you.


This is my test.
The 1°, 4°, and 8° tube have note PH.
The other tube have sure PH between the note tube, but is possible estimate the ph.
Becouse the tube have different color in relation of the point I will choose a precise point where I mesure alweys the color.
Thank.

Hello Diego -

If possible / practical, I would recommend having each tube in a
separate image. This avoids issues such as having the lighting
change a bit across the image, and hence from one tube to the
next. Also, the color from one tube shows up in the background,
possibly affecting the color of the neighboring tubes. Last, if you
position your tubes repeatably, you could then used a fixed ROI,
the same for each tube / image, to measure the color, and avoid
manually selecting the ROI or trying to write some fancy algorithm
for choosing the ROI.

Regardless of whether you use a separate, repeatable image for
each tube and a fixed ROI or a group image with hand-selected
ROIs, I would then calculate each tube’s rgb color as an average
over the ROI. You have known, reference pH values and their
corresponding measured colors. I would then interpolate between
the reference pH values in 3d rgb space (e.g., draw a straight
line between them), and then for each tube whose pH I wanted
to measure, I would find the point on the interpolation line that is
closest to the measured color of the tube, and use the interpolated
pH value for the tubes “measured” pH.

Note, I would definitely use a color averaged over an ROI, rather
than the color of just a single pixel. You’ll be making use of much
more information, and averaging away noise.

(You could also consider interpolating with respect to just hue or
hue / saturation, but my intuition tells me this might be throwing
away some information. I could well believe that the brightness
of the pH indicator dye changes with pH, and if so, you would
want to make use of the full rgb information.)

Thanks, mm