Estimating areas from images

One technique in estimating areas from images is through the use of Green’s Theorem. Given a closed region R on the xy plane, its area can be calculated as

continuous form
discrete form

where the Nb in discrete form refers to the number of pixels in the contour of R.


Area of circular aperture

We check the algorithm on a simple geometric figure such as a circle with known area. I started by creating a 500 x 500 pixel image with a circle of radius r=0.5 (125 pixels). I used Scilab to create an accurate circular image.


Next was to get the edge of the circle so we can apply the algorithm. This can be done by using a built-in function edge(). The resulting images would look like the one below.


After using the edge() function, we can now have the pixel coordinates of all the pixels that form the edge of the circle using find(). We would then arrange these pixels in order of increasing angle i.e., starting from the pixel with angle of zero degrees with respect to the positive x-axis.

In finding the angles, we need to set a reference point or origin. This point is a pixel within the edge such that any line starting from the reference point intersects only one edge pixel. This a necessary requirement for the algorithm to work. For my case, I chose the center of the circle as the reference point which has pixel coordinate of (255,255). Each pixel coordinate in the edge will be transformed to Cartesian coordinates with the reference point at the chose pixel origin.

The angle theta can be calculated using . The range of the inverse tangent function is only from -pi/2 to pi/2. We find the reference angle depending on the signs of the x and y coordinates.

Next was to sort these angles and use the discrete form equation in calculating the area. Below is the code in implementing the area calculation.


The estimated area was found to be 48871 pixels. We know that the radius of the circle was 125 pixels. This means that the actual area was 49087 pixels. Using the algorithm, we had an error of 0.44%.


Area of university acad oval

We now use the algorithm to estimate the area  of an irregular shape such as a landmark map of building. In my case, I tried to estimate the area of a track oval of the University of the Philippines. Below shows the map image with its physical area according to google maps. Total area was shown to be 227,042.87 sq. m.


We follow the same steps as with the circle, delineate the edges of the image and convert it to monochrome to easily find edge pixels.

Using the algorithm, the measured area in pixels was 199,720 pixels. We get the ratio of the number of pixels to the physical distance (in meters) of the area. This ratio was calculated to be 0.825 pixels / meters. Using this as the conversion factor, the estimate area using the algorithm would be 200,946.95 sq. m. This has an error of 11.5% which can be attributed on the how accurate was the delineation of the edge.


Author: klguial

undergraduate physics student

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s