# Area of a image region

I've applied Mathematica to the problem of estimating the area of an estuary, but when I got the results I wasn't able to understand in which unit of area it was given. My approach is the following:

Here is the image of the shape of the estuary:

The horizontal line in the lower right side represents the scale, namely its length represents 1 kilometer.

Using the routine:

img = Binarize@
Import["C:\\Users\\Klën\\Documents\\Wayner - USP\\Rio Doce\\No \
estuário\\cont2.jpg"]~Erosion~1;
(m = MorphologicalComponents[img]) // Colorize


I've got:

And, applying the following code I've got the total area of pink region

in[63] = 2 /. ComponentMeasurements[{m, img}, "Area"]
out[64]= 461259.


But I really don't know in wich units the result is given, I would like to show the results in $km^{2}$, how could I do that?

• Use the "get coordinates" tool to find out how many pixels wide the scale is, then divide your area by the square of that. Nov 29, 2015 at 4:16
• Thank you @Pickett, then Is the unit always given in pixels? Nov 29, 2015 at 4:22
• For operations on 2D images I can't think of any other unit. Nov 29, 2015 at 5:14

## 1 Answer

linecount =
3 /. (Binarize@Import["https://i.stack.imgur.com/Wmeps.jpg"] //
ColorNegate // Thinning //
ComponentMeasurements[#, "PerimeterCount"] &);
areacount =
2 /. ComponentMeasurements[MorphologicalComponents[img], "Count"];
areacount/linecount^2 // N


9.70249

The area is $9.70249 km^2$ I think.