How do morphological operations work at/near image baundaries?

2 visualizzazioni (ultimi 30 giorni)
Hi
Hi, I want to track the edge of a feature in an image. The feature extends from the lower boundary to the top boundary of the image and so does the edge I want to track. An example of this looks like:
Before I identify the edge I use different morphological operations imclose() and imopen(). The result is sometimes not as I expected near the image boundaries. Often the line indicating the edge is vertical (like at the top boundary) when it should be inclined to vertical (Like at the lower boundary).
When I apply filters like:
h = fspecial('disk',12);
Im3 = imfilter(Im2,h,'replicate');
I have the option to choose how the filter behaves near the boundaries using options like 'replicate'. That made me think:
How does the imclose() and imopen() work near the image boundaries and is it possible to control it in a similar way to the boundary options for imfilter()?
Best regards, Brian

Risposta accettata

Michael Abboud
Michael Abboud il 27 Set 2016
The function “imopen” performs a morphological erosion followed by a dilation, while “imclose” does these operations in the opposite order. Therefore, there is no single rule or property for padding in these functions, rather each erosion and dilation follows its own rule.
In particular, MATLAB pads images with the value 1 or 255 (depending on the data type) when performing a morphological erosion, and a value of 0 when performing a dilation.
This standard is meant to reduce the possible edge effects from morphological functions. You can find more information at the following documentation page:

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by