This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

vision.MorphologicalBottomHat System object

Package: vision

Bottom-hat filtering on image


    Note:   The vision.MorphologicalBottomHat System object will be removed in a future release. Use the imbothat function with equivalent functionality instead.

The MorphologicalBottomHat object performs bottom-hat filtering on an intensity or binary image. Bottom-hat filtering is the equivalent of subtracting the input image from the result of performing a morphological closing operation on the input image. The bottom-hat filtering object uses flat structuring elements only.

    Note:   Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.


H = vision.MorphologicalBottomHat returns a bottom-hat filtering object, H, that performs bottom-hat filtering on an intensity or binary image using a predefined neighborhood or structuring element.

H = vision.MorphologicalBottomHat(Name,Value) returns a bottom-hat filtering object, H, with each 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.



Specify type of input image or video stream

Specify the type of the input image as Intensity or Binary. The default is Intensity.


Source of neighborhood values

Specify how to enter neighborhood or structuring element values as one of 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 you can specify structuring elements only by using the Neighborhood property. You can not specify structuring elements as inputs to the step method. The default is Property.


Neighborhood or structuring element values

This property applies only when you set the NeighborhoodSource property to Property. If specifying a neighborhood, this property must be a matrix or vector of 1s and 0s. If specifying a structuring element, use the strel function. The default is strel('octagon',15).


cloneCreate morphological bottom hat filter 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 bottom-hat filtering on input image


Perform bottom-hat filtering on an image.

 I = im2single(imread('blobs.png'));
 hbot = vision.MorphologicalBottomHat('Neighborhood',strel('disk', 5));
 J = step(hbot,I);
 subplot(1,2,1),imshow(I); title('Original image');
 title('Bottom-hat filtered image'); 


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

Introduced in R2012a

Was this topic helpful?