Thursday, September 22, 2011

Activity 12 – Preprocessing of Handwritten Text

I know this is very late but I have managed to finish this activity long ago. This late blogging is due to my laziness from the time this activity was done. Sorry for this one. Anyway. Here it goes.

Figure 1 shows the (a) original image and the (b) rotated image to align the texts horizontally. The rotation was done using mogrify function of scilab.

image

Figure 1. (a)Original image and (b) rotated image

After the rotating the image, the image was cropped shown in Figure 2(a,top) and the horizontal lines found in the cropped image was removed by taking the Fourier Transform of the rotated image and masking the  y – axis of the Fourier plane shown in Figure 2(b,bottom).

image

Figure 2. (top row) (a) cropped image and (b) processed image. (bottom row) FT of the top row of (a) and (b).

The binarized image is shown in Figure 3.

image

Figure 3. Binarized cropped image.

The next tasked was to find another circumstance in the image file that the word DESCRIPTION occurs. It was done by correlating an image that has the word DESCRIPTION with the rotated image. This image is shown in Figure 4.

image

Figure 4. (top) Binarized cropped image of the original image, (middle) template for the word DESCRIPTION and (bottom) the correlation of the first two images

I will give myself of 7.5. Thank you for reading this.

1 activity down, 5 more to go. I hope I can finish blogging the remaining 5 activities tomorrow.

Good Day!

Tuesday, September 6, 2011

Activity 13 – Image Compression

A late submission for a topic that I somewhat did not understand much. Anyway. In this activity, Principal Component Analysis (PCA) were implemented.

The image as shown in Figure 1(a) was gray-scaled, cropped and tiled vertically shown in Figure 1(b).

new text
Figure 1. (a)Original Image and (b)cropped 10x10 image

Next in line was to get the Principal Components (PC) of the image using the function pca of scilab. The eigenvalues and correlation circles are seen in Figure 2.

image
Figure 2. (a) Correlation Circle and (b) Eigenvalue of the PCs

For proper visualization of Figure 1(b), it was tiled into a matrix as shown in Figure 3.

eigen images
Figure 3. Eigen-images of the PCs

The next four images shown in Figure 4 are the reconstruction with the use of 1, 2, 3, and 4 eigenvectors in reconstructing the original image in black & white. The file size of the compressed images were obtained and compared to the file size of the gray-scaled original object.

image

In these four images, only the first image was compressed to 17% of the original image using one eigenimage. The rest of the images becomes bigger in file size using large number of eigenimages due to the white reconstruction along the edges of the object in the image.

I will rate myself with 9.5. This activity was kind of tricky at first but when the code was ok, everything follows.

2 down, 4 to go.. Again, sorry for my laziness because this activity should have been blogged way way before I blogged Activity 12. Thank you for your time. Smile