applies a morphological filter to an image
FilteredImage = MorphologicalFilter(Image, FilterType, LogicalMatrix);
2D matrix of type uint8, uint16, uint32 or double
one of the constants FILTER_DILATE, FILTER_ERODE, FILTER_CLOSE, FILTER_OPEN, FILTER_TOP_HAT or FILTER_BOTTOM_HAT defined in loader.sce of IPD toolbox
2D matrix of type boolean
matrix of the same type and size as Image
This function applies a morphological filter to an image. DilateImage, ErodeImage, CloseImage, OpenImage, TopHat and BottomHat call this function so you do not need to call it yourself.
Image = 0.5 * ones(9, 9) // generate gray image Image(:, 3) = 0 // draw dark line Image(:, 7) = 1 // draw light line StructureElement = CreateStructureElement('square', 3) // generate structuring element global FILTER_DILATE; ResultImage = MorphologicalFilter(Image, FILTER_DILATE, StructureElement.Data) | ![]() | ![]() |