Tuesday, July 28, 2009

Activity 10. Preprocessing Text

A preselected image was processed using Scilab. A portion of the image containing a handwritten text was selected and read using Scilab. The image was then converted into a grayscale image and was tilted using the im2gray and mogrify command, respectively. The image was then enhanced using a filter. The original image, filter and the enhanced image are shown below.



The image was then binarized and inverted. The resulting image is shown below.



The image was then further enhanced using dilate and erode command in Scilab. The enhanced image is shown below.

Comparing the two previous images it can be seen that most of the black lines were removed in the latter image. It can also be observed that the characters are thicker than the first enhanced image. Using bwlabel in Scilab, it was found out that 38 clusters were formed in the last enhanced image. The number of cluster in the enhanced image is close to the number of clusters in the original image.

The image of the receipt was then loaded into Scilab. The image was then converted to binary image. The word 'DESCRIPTION' was then cut out from the image and another image was generated with thw word 'DESCRIPTION' at the center of the image. The newly generated image was then correlated with the image of the receipt. The results are shown below.



Three bright points on the correlated image were observed. The bright spots are where the word "DESCRIPTION" is located at the original image.

I will give myself 10/10 for accomplishing the tasks in this activity

**Tips from Gilbert helped a lot.

No comments:

Post a Comment