Skip to main content

Posts

Showing posts from August, 2012

Activity 9 Applications Morphological Operations 2 of 3 : Playing Musical Notes though Image Processing

For this activity, we will try to read a sheet music via image processing and play the music using Scilab. A sheet music is basically black and white so it is easy to separate the notes from the background by thresholding and applying morphological operations.  The first task for this is to find a sheet music. I used the song Clementine and the sheet music is found in Figure 1. Figure 1. Sheet music for Celementine To make processing easier we divide the sheet into different lines. In this case we have four lines as shown in Figure 2. Figure 2. The 4 lines in the sheet music of Clementine were separated  (line 1 to 4 from top to bottom) We then binarize the images with a threshold of 0.95 and invert them such that the background is black and the foreground is white. We disregard the area of the image where the clef is located. Using morphological operations, specifically CloseImage(),OpenImage() and ErodeImage() we reduce the notes into small blobs. We then

Activity 8 Applications of Morphological Operations 1 of 3: Pre-processing Text

In this activity, we aim to be able to extract text (handwritten or typed) using image processing techniques that we have learned. The image in Figure 1 is the source of the text we need to extract.   Figure 1. Image of a document from which text will be extracted The image is tilted so it was rotated using Gimp 2.8. Using the same software, I selected a portion of the image and cropped it (Figure 2a). The image was then loaded in Scilab 4.1.2 and converted to grayscale for image processing. The grayscale image is shown in Figure 2b.   Figure 2. (a) Cropped portion from the rotated image of the document  (b) grayscale version of the patch in (a) The first task was to remove the lines, to do this, I took the fftshifted FT of the grayscale image and multiplied it by a mask to filter out the higher order frequencies that contribute to the lines. I then took the inverse FT to get the image with the lines removed. I then binarized the image and inverted it so that I can

Activity 7: Morphological Operations

When talking about morphology, what immediately comes to mind are the forms and structures or shapes of objects. Hence, performing morphological operations imply that the shape or form of an object is altered.       In this activity, we will perform morphological operations on binary images. In particular, we make use of erosion and dilation . Erosion and dilation were performed on the following: 1. A 5×5 square 2. A triangle, base = 4 boxes, height = 3 boxes 3. A hollow 10×10 square, 2 boxes thick 4. A plus sign, one box thick, 5 boxes along each line Using each of the structuring elements below: 1. 2×2 ones 2. 2×1 ones 3. 1×2 ones 4. cross, 3 pixels long, one pixel thick. 5. A diagonal line, two boxes long, i.e. [[0 1],[1 0] ].      When performing these operations, it is important to note the “anchor” or “origin” of the structuring element in order to give an accurate prediction of the result. For the 2x2 ones, 2x1 ones, and 1x2 ones, the origin