Documentation

This is machine translation

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

imhmin

H-minima transform

Syntax

  • I2 = imhmin(I,h)
    example
  • I2 = imhmin(I,h,conn)

Description

example

I2 = imhmin(I,h) suppresses all minima in the intensity image I whose depth is less than h, where h is a scalar. Regional minima are connected components of pixels with a constant intensity value, t, whose external boundary pixels all have a value greater than t. By default, imhmin uses 8-connected neighborhoods for 2-D images, and 26-connected neighborhoods for 3-D images. For higher dimensions, imhmax uses conndef(ndims(I),'maximal').

I2 = imhmin(I,h,conn) computes the H-minima transform, where conn specifies the connectivity.

Code Generation support: Yes.

MATLAB Function Block support: Yes.

Examples

collapse all

Create a sample image with two regional minima.

a = 10*ones(10,10);
a(2:4,2:4) = 7;
a(6:8,6:8) = 2
a =

    10    10    10    10    10    10    10    10    10    10
    10     7     7     7    10    10    10    10    10    10
    10     7     7     7    10    10    10    10    10    10
    10     7     7     7    10    10    10    10    10    10
    10    10    10    10    10    10    10    10    10    10
    10    10    10    10    10     2     2     2    10    10
    10    10    10    10    10     2     2     2    10    10
    10    10    10    10    10     2     2     2    10    10
    10    10    10    10    10    10    10    10    10    10
    10    10    10    10    10    10    10    10    10    10

Suppress all minima below a specified value. Note how the region with pixels valued 7 disappears in the transformed image because its depth is less than the specified h value.

b = imhmin(a,4)
b =

    10    10    10    10    10    10    10    10    10    10
    10    10    10    10    10    10    10    10    10    10
    10    10    10    10    10    10    10    10    10    10
    10    10    10    10    10    10    10    10    10    10
    10    10    10    10    10    10    10    10    10    10
    10    10    10    10    10     6     6     6    10    10
    10    10    10    10    10     6     6     6    10    10
    10    10    10    10    10     6     6     6    10    10
    10    10    10    10    10    10    10    10    10    10
    10    10    10    10    10    10    10    10    10    10

Input Arguments

collapse all

Input array, specified as a nonsparse numeric array of any dimension.

Example: I = imread('glass.png'); BW = imhmin(I,80);

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical

h-minima transform, specified as a nonnegative scalar.

Example: b = imhmin(a,4)

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Connectivity, specified as a one of the scalar values in the following table. By default, imhmin uses 8-connected neighborhoods for 2-D images and 26-connected neighborhoods for 3-D images. For higher dimensions, imhmin uses conndef(numel(size(I)),'maximal'). Connectivity can be defined in a more general way for any dimension by using for conn a 3-by-3-by- ...-by-3 matrix of 0s and 1s. The 1-valued elements define neighborhood locations relative to the center element of conn. Note that conn must be symmetric around its center element.

Value

Meaning

Two-dimensional connectivities

4

4-connected neighborhood

8

8-connected neighborhood

Three-dimensional connectivities

6

6-connected neighborhood

18

18-connected neighborhood

26

26-connected neighborhood

Example: b = imhmin(a,4,4)

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Output Arguments

collapse all

Transformed image, returned as a nonsparse numeric array of any class, the same size as I.

More About

collapse all

Code Generation

This function supports the generation of C code using MATLAB® Coder™. Note that if you choose the generic MATLAB Host Computer target platform, the function generates code that uses a precompiled, platform-specific shared library. Use of a shared library preserves performance optimizations but limits the target platforms for which code can be generated. For more information, see Understanding Code Generation with Image Processing Toolbox.

When generating code, the optional third input argument, conn, must be a compile-time constant.

MATLAB Function Block

You can use this function in the MATLAB Function Block in Simulink.

References

[1] Soille, P., Morphological Image Analysis: Principles and Applications, Springer-Verlag, 1999, pp. 170-171.

Introduced before R2006a


Was this topic helpful?