Posts

Showing posts from August, 2012

Activity 08: Application of Morphological Operations - Preprocessing Text

Image
Before the appearance of computers, or even typewriters, simple writing on a piece of paper was the one of the more primitive ways of writing something.  Writing is representing words in a language into set of symbols (depending on which language or alphabet). What is interesting is that each person has a unique way of writing thus hand-written texts by each person is different.  Hand-writing, even today, is popularly used to identify a person. (like forgery) In this activity, I tried to extract handwritten text from a scanned document.  Note that sometimes, handwritings are very difficult to discern specially if the writing is "ugly". The scanned image used was Scanned Image (with handwritings) Initial observation of the scanned image was that it was tilted.  The image was therefore rotated accordingly to have the horizontal lines aligned properly.  This was done using Gimp 2.  The gridlines were used as reference.  Though not the all the ...

Activity 09: Applications of Morphological Operations - Playing Notes by Image Processing

Image
Listening to music has been one of my practices when I'm studying.  It gives the sense that you are not alone.  There is no deafening silence. One to translate music is through a score sheet.  A score sheet with notes will serve as guide to any musician to play the music.  To produce these notes, any instrumental device is usually used. (For such, I prefer a piano). However, we can also play music using image processing! Imagine that.  Instead of just programming with recognizing text like from the previous activity, you can also play notes so long as you know the frequency and duration of each note. The first part was to find the score scheet of a piece.  A musica score for "Bahay Kubo" was my choice.  The sheet is shown below. Bahay Kubo music sheet (source:) The sheet was then divided into 3 parts, with removed clefs, numbers, and words.  This is shown below. Region of interest (with notes for the song) without the clefs, numb...

Activity 07: Morphological Operation

Image
Morphology refers to shape.  This is usually done to images with blobs that form a specific shape.  What it can usually do is eliminated few pixels, fill gaps in between or even connect separate blobs of pixels to improve its shape.  The background is of the value zero, and the foreground is 1.   Dilation and erosion are morphological operations to used in this activity. Dilation of A by B is given by the equation: B is the structuring element such that the effect of dilating is to EXPAND or ELONGATE A in the shape of B.  This is illustrated in the figure below. Dilation by structuring element B on A, and the result of expansion of A . Erosion, on the other hand, would REDUCE the shape A by the shape B.  This is given by the equation: and is illustrated in the figure below. Erosion be structuring element B on A, and the result of reduction of A. Erosion and dilation are duals such that having a shape A, and structuring element B: The f...