Tuesday, June 23, 2009

Image types and basic image enhancement

Shown below are the examples of the different types of images with their corresponding properties.


Figure1. True Image
Image Properties:
Truecolor Image
FileName: true color.jpg
FileSize: 178712
Format: JPEG
Width: 411
Height: 500
Depth: 8
StorageType: truecolor
NumberOfColors: 0
ResolutionUnit: inch
XResolution: 72.000000
YResolution: 72.000000


Figure2. Indexed Image
Indexed Image
FileName: index_m.jpg
FileSize: 10590
Format: PNG
Width: 174
Height: 200
Depth: 8
StorageType: indexed
NumberOfColors: 256
ResolutionUnit: centimeter
XResolution: 72.000000
YResolution: 72.000000



Figure3. Grayscale Image

Size: 257 rows X 200 columns
Indexed Image
FileName: 200px-Breadfruit.jpg
FileSize: 9272
Format: JPEG
Width: 200
Height: 257
Depth: 8
StorageType: indexed
NumberOfColors: 256
ResolutionUnit: inch
XResolution: 100.000000
YResolution: 100.000000


Figure 4. Binary Image
Size: 352 rows X 353 columns
Indexed Image
FileName: Leopard_bw.bmp
FileSize: 16960
Format: BMP
Width: 353
Height: 352
Depth: 8
StorageType: indexed
NumberOfColors: 2
ResolutionUnit: centimeter
XResolution: 118.080000
YResolution: 118.080000

The scanned image I chose was converted to grayscale type using GIMP software. Here, the histogram is taken also by using GIMP. These are shown in the figures below:



Notice from the histogram that all graylevels (0-255) are well distributed. Thus, we can say that the region of interest (ROI) is well separated from the background.
After this, the image was again converted to binary type with threshold level of 0.4. This seems to be the best threshold since it still shows similar information of the image. From the code generated to find the area of several polygons in Activity 2, the area of the image was calculated.The theoretical value of the area was taken by counting the number of pixels in the binary image. This was done by summing up all the 1's in the image, since the pixel values are only 1 and 0.




The 9% error can be attributed to the curved contour of the image that was not included upon performing the formula in the Green's theorem.

The histogram for the grayscale image can also be done using Scilab. The following code shows how:
//histogram
hist=[];
counter=1;
for i=1:256;
num=find(scanimg==i);
hist(counter)=length(num);
counter=counter+1;
end;

Notice the high correlation between the histogram from GIMP and Scilab. This means that the code is correct.

In this activity, I am giving myself a grade of 10 since all the tasks have been done with pretty good results.

References for the images:
true image: http://farm4.static.flickr.com/3272/2789704173_3bbc22342b.jpg

indexed image: http://en.wikipedia.org/wiki/Indexed_color

grayscale image: http://en.wikipedia.org/wiki/Black-and-white

binary image: http://www.scouting.org.za/clipart/badges/cubadvancement/Leopard_bw.bmp

No comments:

Post a Comment