Documentation Center

  • Trial Software
  • Product Updates

vision.MorphologicalClose System object

Package: vision

Perform morphological closing on image

Description

The MorphologicalClose object performs morphological closing on an intensity or binary image. The MorphologicalClose System object performs a dilation operation followed by an erosion operation using a predefined neighborhood or structuring element. This System object uses flat structuring elements only.

Construction

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

H = vision.MorphologicalClose(Name,Value) returns a morphological closing 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.

Properties

NeighborhoodSource

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

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 strel('line',5,45).

Methods

cloneCreate morphological close 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 closing on input image

Examples

Perform morphological closing on an image.

 img = im2single(imread('blobs.png'));
 hclosing = vision.MorphologicalClose;
 hclosing.Neighborhood = strel('disk', 10);
 closed = step(hclosing, img);
 figure;

 subplot(1,2,1),imshow(img); title('Original image');
 subplot(1,2,2),imshow(closed); title('Closed image');

Algorithms

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

See Also

| | |

Was this topic helpful?