joshmccraney said:
Are you referring to this plug-in:
No, I'm referring to a course ( pattern recognition ) where I participated years ago, and a lot of experience afterwards.
First of all, you must convert this ".jpg" file into a ".bmp" file, gray scale with no compression. Now you can directly read color values pixel by pixel in the file.
By some spatial method you can enhance vertical and horizontal lines separately. By a Hough transform, you can determine two vertical ( you know where about ) lines in the image ( edges of the cup ). So now you can determine the vertical center axis in the cup.
The surface of the water in the cup ( middle section ) may then be expressed something like: y = ax
2 + b , ( a<0 ). From the horizontal edge ( water surface ), you can determine sets of (x,y) placed on the surface edge, so knowing an edge pixel, you have two unknown: "a" , "b".
Now you "guess" some different values as for "a", until a "sharp" value as for "b" is found by means of a Hough transform. I think that this "b" is the value you want to determine. The Hough transform is a
statistical method to find such a value, and it can be determined within at most 0.1 pixel accuracy.
If you include a vertical scale in the picture ( ml ), you may automatically read out the volume in ml.
The calculation steps are quite simple, but the number of calculations - say 5 megapixels - are huge. Therefore FPGA's are often used to support a processor in practical applications. But stick to assembler programming

. Then I think you can calculate an image within, say 10 sec. ( not real time ).