Wednesday, June 24, 2009

Activity 2: Area estimation for images with defined edges

In this activity we set out to determine the area of an ROI in a binary image by first tracing its contour then using Green's theorem to calculate the area enclosed. To prepare the image for processing, I first had to convert the image to a binary matrix using the im2bw function. I then used the follow function to trace the ROI's contour. I then implemented the discrete form of green's theorem to finally come up with the area.

After preliminary results Ifound that the area we would calculate was always lacking by half of the contours length. I speculated that the follow function traced the inner contour of the ROI, thus decreasing the area enclosed by some value. M. Sison proposed that to correct the calculated area, we simply add half the length of the contour. After testing the method over various shapes, both regular and irregular, we found the the proposed correction was indeed valid.

Sample Results

Shape 1: 200 x 200 Square

Analytical: 40000 pixels
Pixel count: 40000 pixels
Program: Analytical: 40000 pixels

Shape 2: Robot

Analytical: 32071 pixels
Pixel count: 32701 pixels
Program: 32071 pixels

Shape 3: Irregular

Analytical: N/A
Pixel count: 26526 pixels
Program: 26526 pixels

For this experiment, I give myself a score of 10/10 because I was able to implement the method properly and the results attest to the accuracy of the program.


No comments:

Post a Comment