Sunday, August 11, 2013

Plastic Surgery. A10, morphological operations

I find it odd that it's the first time I heard of these morphological operations namely erosion and dilation. I guess what we know is the very basic which is resize, paliitin or palakihin. In essence, erosion is decreases while dilation increases the image or shape. However, it goes beyond just increasing or decreasing the size but also changes the shape of the image more into a certain structuring element. It actually feels very much like correlation- which results in an image that is in between two images. The difference with this is that there is a change in size as well.

Before we go into the code, we were asked to draw our expected results. While we're at it, I also demonstrated my drawing and coloring skills or lack of it. I'm tempted to ask you not to judge. The reactions of my friends would determine who my true friends are :P
The images below are scans of my guesses for the given shapes and structuring elements. The columns show the result for the certain structuring element which are from left to right a 2x2 square, 2x1 rectangle, 1x2 rectangle a 2 element diagonal and a 3x3 cross. The rows denote whether it undergoes erosion or dilation.
 fyi, i did pass preschool

 and that's why they invented ms paint

fyi, my eyesight is still 20-20

sa panahon ngayon, mahirap na talaga makahanap ng straight

Aside from my fine motor skills, I also apologize that some of my guesses are wrong as exhibited by the results in Scilab shown below. The first set shows the effects of erosion. The first column are the original shapes which are, again, a square, a 'triangle', square frame and cross. The other columns are the result of erosion with structural elements in the first row.
scilab skills > fine motor skills

And finally, below is dilation with the same format.

Comparing my expected results with the actual ones, we find that my guesses aren't so bad. I'm tempted to leave the comparison to you so you'd have to put additional effort to find the differences. Haha. Well, I'll give you some. For the square, I got most of the erosion right except the diagonal. Similarly, the only difference is the cross for the dilation. The dilation with the diagonal is also not spot on but close enough. The idea is there anyway. I don't really want to talk about the erosion of the triangle but I did get some right for dilation. There are slight differences for the square frame. Again, at least the idea is there. I have an idea on the general shape of the result. I didn't however, get the dimensions right. The dilation of the cross looks pretty good except that I mixed up the result with the square and cross structuring element. Again, for erosion, I know where to make bawas in the image but not how much so I didn't get the cross and diagonal.

Just a note especially to the kids. (as if the future generations would use my blog as a basis for their own. well, you never know. well if you are, you're doing it wrong. visit some of my more hardworking batchmates' blogs! hahaha) I initially had a problem especially with the solid square. Apparently, the original image needed black spaces. I originally made a solid white 5x5 square. I got quite frustrated since nothing was happening no matter what I dilate or erode it with.

I have to say, this activity is a bit different from the others. For one, we were asked to draw. It's not the most interesting topic but I still like it because it is relatively shorter and easier to understand than the others. I give myself a 9 since I believe I made a solid effort for a straightforward activity. I'm also proud to say that I did this activity all by myself! Although, I did get a little help from Eric- I asked him for graphing paper. Ironically, I only got one piece from him and made mistakes on it. Good thing I had some more around the house. Thanks Eric! :D

No comments:

Post a Comment