Matlab. Dilate, Erode & Open-Close functions

matlab_in-actionWhile playing around with basic types of grayscale and binary images in , I’ve found few nice functions to be used to perform simple morphological changes and noise clearance of an image.

If you have to use a basic morphological changes to your grayscale image, I think ’s impossible to avoid imerode() and imdilate() functions, which give the ability of (as you guessed!) erosion and dilation binary, grayscale or packed images.

Of course, to perform these changes you should use strel() function with predefined structural elements, which will be used in dilation and/or erosion functions. The links provided in the post will give a huge amount of description concerning these functions with examples of its usage.

The other function I’d like to mention are fully dependent on dilate/erode pair, since combining these two, we can provide better elimination of noise with keeping initial image morphology.

The functions imopen() and imclose() use same arguments passing through therefore you can achieve better with writing simply another few lines of code.

One Response

  1. Matlab offset values and histograms Says:

    [...] Matlab erode and dilate functions - offset procedure doesn’t effect the neighbouring pixels - all the actions are performed on [...]

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.