Documentation Center

  • Trial Software
  • Product Updates

vision.MorphologicalDilate System object

Package: vision

Perform morphological dilation on an image


The MorphologicalDilate object performs morphological dilation on an image.


H = vision.MorphologicalDilate returns a System object, H, that performs morphological dilation on an intensity or binary image.

H = vision.MorphologicalDilate(Name,Value) returns a morphological dilation System object, H, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1, Value1,...,NameN,ValueN).

Code Generation Support
Supports MATLAB® Function block: Yes
System Objects in MATLAB Code Generation.
Code Generation Support, Usage Notes, and Limitations.



Source of neighborhood values

Specify how to enter neighborhood or structuring element values as Property or Input port. If set to Property, use the Neighborhood property to specify the neighborhood or structuring element values. Otherwise, specify the neighborhood using an input to the step method. Note that structuring elements can only be specified using Neighborhood property and they cannot be used as input to the step method. The default is Property.


Neighborhood or structuring element values

This property is applicable when the NeighborhoodSource property is set to Property. If you are specifying a neighborhood, this property must be a matrix or vector of 1s and 0s. If you are specifying a structuring element, use the strel function. The default is [1 1; 1 1].


cloneCreate morphological dilate object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs from step method
isLockedLocked status for input attributes and non-tunable properties
release Allow property value and input characteristics changes
stepPerform morphological dilate on input


Fuse fine discontinuities on images.

 x = imread('peppers.png');
 hcsc = vision.ColorSpaceConverter;
 hcsc.Conversion = 'RGB to intensity';
 hautothresh = vision.Autothresholder;
 hdilate = vision.MorphologicalDilate('Neighborhood', ones(5,5));
 x1 = step(hcsc, x);
 x2 = step(hautothresh, x1);
 y = step(hdilate, x2);

 subplot(3,1,1),imshow(x); title('Original image');
 subplot(3,1,2),imshow(x2); title('Thresholded Image');
 subplot(3,1,3),imshow(y); title('Dilated Image');


This object implements the algorithm, inputs, and outputs described on the Dilation block reference page. The object properties correspond to the block parameters.

See Also

| | |

Was this topic helpful?