In this activity we would use all that we have learned to preprocess handwritten text. We would choose from the two images that was given and then crop a portion of it that we would like to process. The image that I chose is shown below as well as the portion I want to work on. I chose that portion since it has the most number of text and it seems that the handwriting is fine.
We need to remove the lines that are present in order for us to see only the text. From the previous activities, we do this by making a filter in the frequency domain and blocking the frequencies corresponding to this lines. From previous activities we know the horizontal lines correspond to a vertical line at the center in the frequency domain. We check this by looking at the Fourier transform of the image. The FT and the mask created is shown below.
The resulting image is shown below.
The lines are already removed enough for the text to be isolated. Now we need to binarize the image. We do this by looking at its histogram and getting the threshold. I have done this and also inverted the colors since the background should be black and the text should be white for us to use morphological operations in scilab. The resulting image is shown below.
The letters are still readable in this case. We just need to close the gaps that the lines have made and also to make the text only one pixel in thickness. We do this by using the close operation. I use a 2*1 structuring element in this case. I also eroded it by the a same structuring element for the letters to thin out. The resulting image is shown below.
The lines are already removed and also the handwriting can still be recognized like the VGA Cable and the 2 Cable text below. I rate myself 10 out of 10 for this activity since I have successfully done the task and have applied what I learned in the previous activities. I have done this at home since I could not come to class.
Subscribe to:
Post Comments (Atom)
1 comment:
Hi Mer,
Yours is the best solution i've found so far. You got the lines out and the letters you made almost whole again. One suggestion, you can probably use thin to make the letters appear one pixel thin.
Post a Comment