infile is the file of annotations that you saved earlier.
outfile is the file you want to write the results to. Here's an example using a file stored in the tempbox
brian
.gsh ../scripts/groovy/process_simplearea /mbari/Tempbox/brian/my_infile.txt /mbari/Tempbox/brian/my_outfile.txt
The resulting area is in pixels. You need to figure out how big an area a pixel represents. If you have the image width and height you can do the following:
pixelArea = (cmWidth * cmHeight) / (pixelWidth * pixelHeight)
In this equation we are using cm to represent the area, but you can use whatever units are appropriate.
Once you have the pixel area you can do the conversion from pixel area to actual area in your favorite number crunching tool, such as Excel, Matlab or, for the truly awesome, Scala. Just multiply the area column in your outfile by pixelArea.