Essentially, if we choose functions that will somehow uncomplicate the math, we can end up relating the area enclosed by the contour and the circumference of the formed shape. To achieve this, we consider 2 cases: (1) X=0 and Y=x, and X=-y and Y=0. So we get the following 2 equations, where both of the left hand sides correspond to the area R.
Considering these 2 equations, we average the 2 and we get an equation for the area.
Since we're dealing with a finite resolution, we consider the discrete form of this equation, and finally we have the following equation, where Nb is the number of pixels of the contour.
Now that we have discussed the theory, we move on to the activity itself. The first part of the activity was to create images of regular shapes like a circle and a square. Then, using these, Green's theorem was to be employed to measure the area enclosed by the shapes. Since I was able to pass activities 2 and 3 last Wednesday (August 24), I got the instructions for activity 4 and so I was able to work on it earlier than the scheduled class time for the activity. I started with creating an image of a square in bitmap format using Scilab (shape should be white and the remaining areas black).
A 400x400 pixel white square |
Wednesday (August 31) came and it was the officially the start of activity 4. This time, I was able to successfully extract the edge of the square using the 'canny' method of edge extraction available in the edge function (thanks to Harold for the suggestion). I was able to calculate an area of 159997 pixels, which compares quite closely to the analytical area of 160000 pixels, deviating only by 0.0019% (essentially 0%!). I also tried doing this activity on a circle, which is shown below. I calculated an area of 384097 pixels, which also compares quite closely to the analytical area of 384845.1 pixels, deviating only by 0.19%.
A white circle with radius of 350 pix |
Screenshot of Quezon City Memorial Circle in Google map |
Edited image where the area of interest was colored white and the remaining area was colored black |
We have seen how useful Green's theorem is in approximating areas (assuming a flat surface), along with image analysis softwares. Green's theorem more or less accurately approximates areas within closed contours. ImageJ (or other image analysis softwares) simplifies length and area approximation by setting a scale and just tracing the length or area of interest.
I would give myself a grade of 9 since I was able to obtain quite accurate results, except for the approximation of QC circle's area. Nonetheless, I have gained knowledge of the application of Green's theorem (one among a lot of concepts which I wondered where I would use when we were taking Mathematical Physics courses), and I have realized how powerful ImageJ is in image analysis (which I have used in the past only for putting scale bars in scanning electron microscopy images).
No comments:
Post a Comment