The exercise was to compute the area of the square above with dimensions of 100*100. The filename saved is "square.bmp"
Green's theorem was used to obtain a formula for the area of an image in grayscale
The codes for the area estimation is as follows:
Image=imread('square.bmp') // to load the image in scilab
xbasc()
imshow(Image)
[x,y]=follow(Image) //to obtain the edge pixel values of the image
X=size(x,1); //this gives the width of the image
Y=size(y,1); // this gives the height of the image
x2(1)=x(X);
x2(2:X)=x(1:X-1); // this was used for iteration
y2(1)=y(X);
y2(2:X)=y(1:X-1);
Area = 0.5.*sum(x.*y2-y.*x2)
and this gives me an area of 9216 with a percent error of 7.84%
Beth and Rica helped me in this exercise ;)
I rate myself 10/10 for this exercise
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment