When I first heard or thought about it, area estimation did not strike me at all as something complicated or even useful. I was already aware of how area estimation played a role in agriculture, agrarian reform, and other endeavors involving large land areas (such as land grabbing and proffesional squating... haha). But as Ma'am Jing narrated and enumerated all the instances where estimating an area was the key task in the creater scheme of things then I started to realize what a powerful tool it can be. It was quite an eye opener when she shared how the study and treatment of skin cancer heavily relied on area estimation which was done manually. I also remembered that my cousin (a marine science student) once told me that in marine science measuring the total area of leaving corals is a very important task. This made me realize that area estimation is not as simple as it once seemed. Moreover measuring irregularly shaped areas is difficult enough but teaching a computer to do it is even more challenging. In this activity we utilize scilab and its SIP toolbox to write an area estimation code using Green's theorem.
Green's theorem has been and is still used in various area estimation algorithms. There is even an old area estimating instrument called the planimeter (http://en.wikipedia.org/wiki/Planimeter), used in irregularly shaped areas, that is justified by Green's theorem. Named after British mathematician George Green, it is a mathematical relationship of a double integral and the line integral along its boundary (http://en.wikipedia.org/wiki/Green%27s_theorem).



The trial run of the program aimed to calculate the area of a square with one side measuring 178 pixels but, contrary to what I expected, it returned the wrong value. At first I suspected that the difference was that the algorithm did not account for the boundary and Dr. Soriano shared this thought, but I already saw from the values that it was not the case. Then I immediatley noticed that the calculated area was that of a 177 pixel sided square. After some serious thinking and contemplating I had an indea of adding half of the boundary contour. For the square area this was obviously sufficient since the only difference of 177pixel and 178pixel on a side is half of the perimeter, still I had a feeling that this would be valid for all the other shapes. After modifying the code and testing it on sqaures, circles, triangles, and various irregular shapes I was amazed that the program was 100% accurate each time (table 1). Even very crooked curves were not a problem.

Overall I still consider this as a huge success and I have to give myself a pat on the back for such good work. For this I'm giving myself a grade of 10!!! woooohhooooo!!!!
I would first like to thank Dr. Soriano for all the information and insights she shared. I would also like to thank Thirdy for helping me in discovering the limitations of the follow command.
Im = imread('circle.jpg');
Im = im2bw(Im, 0.5);
[x,y] = follow(Im);
len=length(x);
x(len+1)=x(1);
y(len+1)=y(1);
//theoretical area via pixel counting
A1 = sum(Im);
//the additive term 'round((len+1)/2)' accounts for the sections of the boundary that is not included in the sumation
A = round(sum((x(1:len).*y(2:len+1)-y(1:len).*x(2:len+1)))/2) + round((len+1)/2);
//area checking
A==A1
Since you found the solution you deserve an 11.
ReplyDelete