Green's theorem was employed to determine the area of an image region. As we know, the theorem relates a double integral to a contour integral. The area is then now accessible from the data of the bounding contour.
Equation 1. Contour integral of an area bounded by a continuous function
The discrete form of Eq. 1 is then:
Equation 2. Discrete form of a contour integral
Scilab's follow() function extracts the parametric contour of a black and white image, assuming that it has only one definable shape. Using this and Eq. 2, I try it on various circles (generated with our A1 code):
Figure 1. Black and white circles. From biggest to smallest: radius 45, 35, 25, 15 and 5 pixels
Figure 2. Example code for the computation. Note that the if statement simulates a cylindrical symmetry for the indices.
Comparing it with the theoretical A=Pi*(radius^2) computation, I obtain the following graph:
Figure 3. Radius versus percent deviation graph of the 5 circles
Fig. 3 shows that as the radius gets smaller, the % deviation becomes larger. This is expected; as the circle is only approximated by pixels which are ultimately square in shape. We can already see the imperfections get more noticeable as the radii gets smaller in Fig. 1.
Next, I picked a location on Googlemaps, and use the method to approximate the area in square kilometers. I chose the infamous Bermuda Triangle:
Figure 4. Bermuda Triangle, as seen from Googlemaps. Black lines were added by me to border the region
Now, employing the method used in A3, I converted the Fig. 4 to a black and white image then used Paint to convert it to a purely black and white image:
With this, I can now find the area using the same method applied on the circle figures as mentioned earlier. However, the result is in pixels. To convert it to the actual area of the region, I have used Photoshop Elements to find the scaling factor.
Figure 6. 500 km is equivalent to 114 pixels.
With a scaling factor of 4386 meters per pixel, I can now convert the pixel area to actual square meter unit. How do I find for a comparative "theoretical" value for the area? Since the actual region of the legendary Bermuda Triangle varies per author, I can't find an actual official area size. I just settled with measuring the sides (in pixels), then used Heron's method and the scaling factor to find a comparative measurement for the area.
Figure 7. Heron's formula for finding the area of a triangle with sides a, b, and c
Now, Table 2 tabulates all the important data I've obtained from this experiment:
Table 2. Summary of the relevant data for Activity 4
It is evident that there is still a large discrepancy between the Green's and Heron's method of obtaining the area of Bermuda Triangle (2 million square meters). However, being a colossal region, this still came out pretty well with a 0.63% deviation.
Areas with defined edges are now easily computable with the methods I learned from this activity.
Self-Assessment: 10/10
Self-Assessment: 10/10