How to measure an image's contrast? 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?
 A: Whatever software you use (e.g. ImageJ), you must convert the image from sRGB colorspace to a linear colorspace first. To convert to linear RGB using ImageJ, you should convert the image to 32 bit first, divide by 255 and then run the math macro:
if(v<0.040445) v = v/12.92; if(v>0.04044) v = pow((v+0.055)/1.055,2.4)
and then multiply by 255 again.
The gray values of the pixels will then be proportional to the light intensity at the corresponding photo-sites.
A: ImageJ contains all of the tools you will require, is widely used, and is free.  You can even add your own processing modules to extend its capabilities.
Usually the camera used will have to be taken into account when converting pixel brightness into intensities; for scientific work we usually use linear CCD cameras, where the vendor has done the calibrations for us.  
Otherwise refer to the ImageJ tutorial for advice.
A: You could use Matlab: load the image into an matrix, and then find the maximum and minimum entries of the matrix. Plug these into your equation to find the contrast.
Alternatively, for higher accuracy, you could take the lowest and highest (say) 100 values and take the average of those to give you your Imin and Imax, respectively.
