I'm studying Fourier optics and Interferometry and I intend to determine the contrast of an image using computer software. My teacher of Experimental Physics didn't tell me how to do it, and so, I'm requesting some attention from physicists that have already done this kind of analysis.
The contrast can be expressed as:
$$K=\frac{I_{max}-I_{min}}{I_{max}+I_{min}}$$
Consider the following interference spectrum where the object is an soldering iron:
I think it should be possible to measure the contrast, knowing the color of the pixels and their distribution in a certain region.
I know that intensity is proportional to the brightness of the regions. For example, to determine a quantity proportional to $I_{max}$, I just need to study the bright stripes of the image, and the dark ones for $I_{min}$.
My problem here is which software I should use? And is the previous method good to achieve my objective?