Monday, September 3, 2012

Activity 10: Applications of Morphological Operations 3 of 3: Looping through Images

The final activity for the applications of morphological operations is about differentiating shapes with varying sizes in a given image. We will try to isolate the desired regions of interest from background noises.


Figure 1 is an image of circles which are actually punched papers. The whole image was divided into 99 sub-images with a size of 256x256 pixel. This was done automatically and randomly using Scilab.
Figure 1. Image of punched papers

     Figure 2 shows the sub-images. A sub-image was then opened and its histogram was also obtained to know the threshold value. It was found to be 0.8. Using this value, the sub-images were converted into binary sub-images as shown at the right in Figure 2.

Figure 2. Sub-images with 256x256 pixel each and their corresponding binarized sub-images

    The morphological operations such as open and close were used to clean the image. These are not readily available in SIP toolbox. However, these operations can be defined in terms of dilation and erosion operators. 

     Opening operator is the dilation of the eroded image with a same structuring element. It is given by 


where A is the image and B is the structuring element. 

     On the other hand, closing operator is the erosion of the dilated image. It is given by 


     Figure 3 shows the opening and closing of two sub-images. Indeed, the images were cleaned after applying opening and closing operations.

Figure 3. 1st column: original sub-images, 2nd column: Opening operator were applied; 3rd column: Closing operator were applied




      bwlabel  function was used to label each circle. The area of each circle for each sub-image was then calculated. Figure 4 shows the histogram of the area. It can be seen from the histogram that most of the blobs have an area from 450 to 600 pixels.
Figure 4. Histogram of area of blobs


       To obtain the best estimate, the area between the range of 450 to 600 pixels were averaged. Also the standard deviation was obtained. Thus, the area of the blob is 518.25±25.90 pixels. 

     The next task is to isolate the bigger cells shown in Figure 5. It was first turned to binary image with a threshold value of 0.8. 
Figure 5. Image of circles with enlarged circles


     A structuring element was created using a circle with a radius of 15pixels. The radius was such since we need to create a structuring element with an area slightly greater than the obtained area previously. Using morphological operations again, the bigger cells were then isolated from the background noise. Opening operator was used after it was eroded. The resulting image is shown in Figure 6.

Figure 6. Isolated enlarged blobs



References:
[1] Soriano, M. 2012. A10 Applications of Morphological Operations 3 of 3: Looping through Images
[2]en.wikipedia.org/wiki/Opening_(morphology)
[3]en.wikipedia.org/wiki/Closing_(morphology) 


Self-evaluation 
I would give myself a 10 since I was able to produce the necessary output and was able to explain my thoughts clearly. It was a very fun activity. :)

No comments:

Post a Comment