Monday, June 22, 2009

Activity 3. Image Types and Basic Image Enhancement

Images were categorized into true image, binary image, grayscale image and indexed image in this activity. Different images were selected and downloaded from the internet or drawn through Paint. The sample images for the categories of images are shown below.

A. Binary Image
Pixel Dimension: 640 x 360 pixels
Resolution: 72 x 72 ppi



B. Grayscale
Pixel Dimension:1982 x 1973 pixels
Resolution: 300 x 300 ppi
Source:www.press.roncarter.net



C. True Color
Pixel Dimension:640 x 418 pixels
Resolution:96 x 96 ppi
Source:www.jma.go.jp



D. Indexed Image
Pixel Dimension:300 x 300 pixels
Resolution: 72 x 72 ppi
Source:www.crazylikethat.com



An object was then selected and scanned. The image of the object was then converted into gray and black and white. The conversion of the images were done using Scilab. The images are shown below. The first image is the scanned image, followed by the converted grayscale image and the inverse black and white image.


.

The area of the white portion of the third image was computed using Scilab, using a paint and using ruler. The area measured by the ruler was converted from inch to pixels by multiplying the measured value by 75 (since the image is 75dpi). The computed and measured area was then compared. The area computed using Scilab is 90624 pixels and the measured area is 90816.pixels The area measured using the ruler is 96736.275 pixels. The percent error of the area calculation when the area computed by Scilab and the area measured using the ruler was compared is 6.31%. The error in area when the two measured values was compared, with the ruler measurement set as reference, is 6.12%. The code used to compute the area in Scilab is shown below.

a=imread('ed123.bmp')
[x_ed,y_ed]=follow(a);
Area=[]
l=length(x_ed);
for i=1:l-1
Area(i)=x_ed(i)*y_ed(i+1)-y_ed(i)*x_ed(i+1);
end
TotalArea=sum(Area)/2

I will give myself 10/10 for completing this activity.

**Gilbert helped in debugging the code.

No comments:

Post a Comment