Brief introduction

Figure 1: Region enclosed by a contour running in counter-clockwise direction [1].
Area of region in fig. 1 can be calculated using Green’s Theorem which uses line integral of the contour to calculate the area of the region it encloses. The expression is given by
where there exists two continuous functions, and
, which have continuous partial derivatives,
and
, in the domain of region
. Letting
be a set of points
that define the contour of the said region, we get the equations
and
if we set ,
, and
,
. Summing and averaging the equations above, we get the area defined by
.
which has a discrete form, for image processing, given by
.
for pixels defining the contour of
[1].
In this numerical simulation, discrete form of Green’s theorem, eq. 5, was utilized to approximate area of specified region in an image.
Methodology, results, and discussion
Binary image of geometric shapes were synthesized on 50 x 50 pixel matrices, see the left column of fig. 2. Edge detection was applied on these images, as can be seen from the right column of fig. 2, to extract information regarding their contour. Only the contour-defining pixels of the binary images were set to intensity level value of 255. coordinates of these pixels were used to obtain the location of their centroid, which was then subtracted from the rest of the pixels, setting them in the four quadrants of the Cartesian plane. The coordinate system went further towards polar, so that
can be sorted in increasing angle
. After which, Green’s theorem, eq. 5, was implemented on the filled shapes for area estimation.
Figure 2: Synthesized geometric shapes, and their corresponding image after applying edge detection. These shapes were generated on 50 x 50 pixel matrices.
Values obtained are listed in table 1. Pixels, which are image elements, are unit-less. This means that we can treat a single pixel as a unit, whose corresponding area is . The average deviation of the method from the analytic value, for the synthesized image of geometric shapes, is around
, which is acceptable.
Table 1: Estimated area of different binary images, and their corresponding percent deviation from analytic value. Reference value used for the lot area of UP Sunken Garden was obtained from Google Maps through a manual method of connecting lines and dots, which adds systematic error.

The method was also applied on an image, of a location of a place of interest, obtained from an online map website, Google Maps. Fig. 3a shows the lot area of the Sunken Garden located in the University of the Philippines, Diliman. Our user-defined function/command line, which outputs estimated area in square units, works only on clean binary inputs. By “clean,” this means that unwanted artifacts, which are not part of the region of interest, must be removed. Fig. 3 illustrates the sequence of execution. First, image was converted into gray scale. Second, intensity level slicing was applied so that pixels having gray-level value corresponding to that of the lot area are set to 255, while the rest were forced to be on intensity level value of 0. Third, artifacts left after applying the intensity transformation were filtered out. This part can cause accidentally deleting, replacing, and/or adding edges, which adds uncertainty.
Figure 3: Sequence of image processing executed on a scaled 2D representation of UP Sunken Garden’s topview, obtained from Google Maps. The binary image in fig. 3d is wanted, since the coded user-defined function only works on images having pixel values of either 1 or 0.
After converting the colored map, fig. 3a, into a binary image, fig. 3d, area-estimating function was called to analyze fig. 3d. Value obtained was multiplied to the square of the scaling factor to get a quantity with a unit of measurement that makes sense (see user-defined function code for the scaling factor, “Escale”, used). The result obtained has deviation from the value obtained from Google Maps, which has a systematic error induced from the method of connecting-lines-with-dots it provides. Nevertheless, the error is still not significant because it did not touch the threshold,
.

Figure 4: Extracted data after applying edge detection on fig. 3d.
Conclusion
Discrete form of Green’s theorem was used for area estimation of regions defined within a digital image. It was found that the method accumulates error of around for an image of a geometric shape, synthesized in a 50 x 50 matrix of pixels. Images from online map websites can also be utilized, although measurement certainty are further limited by the processes involved on binarizing the imported image, which is necessary for a well-defined edge detection for the region’s contour.
References
[1] M. Soriano. Applied Physics 186 Lab Manual: Area Estimation in Images Using Green’s Theorem [sic].
National Institute of Physics, University of the Philippines. Diliman, Quezon City. 2017.
[2] UP Sunken Garden, Diliman, Quezon City, Philippnes [sic]. Google Maps. Accessed on Sep. 17, 2018. https://www.google.com/maps/place/Up+Sunken+Garden/@14.6548165,121.0713142,18.17z/data=!4m12!1m6!3m5!1s0x3397b76694029b91:0xc92ee8e325944c28!2sUp+Sunken+Garden!8m2!3d14.655212!4d121.071885!3m4!1s0x3397b76694029b91:0xc92ee8e325944c28!8m2!3d14.655212!4d121.071885











