Friday, February 19, 2021

Morphological Transformations

I started playing around with the OpenCV library in Python ("cv2"). Here are some of the mathematical morphological operations that can be done on an image of your choosing:

Here is an example of an "erosion" operation done on an image of a gradient. First, here is the input image that I used, of a gradient I also generated programmatically via Python:

And here is the processed image, using the erosion operation with a 3 x 3 kernel of 1s:

As I said, I've been playing around with these mathematical morphological operations, of erosion, dilation, edge detection and sharpening of images, all using the OpenCV library. The functions are pretty simple to use. The library is really powerful, giving you everything you need at the touch of a simple function. One can also use function composition to use a function on top of a function. I wrote some helper functions to facilitate the task of using the morphological transformation functions.

No comments:

Post a Comment