Hauptinhalt

imextendedmax

Extended-maxima transform

Description

BW = imextendedmax(I,H) computes the extended-maxima transform for the image I, which is the regional maxima of the H-maxima transform.

  • Regional maxima are connected components of pixels with a constant intensity value, and whose external boundary pixels all have a lower value. The H-maxima transform suppresses all regional maxima with a height less than or equal to H.

  • The extended-maxima transform, which is the regional maxima of the H-maxima transform, identifies regional maxima with a height greater than H.

Use the extended-maxima transform to detect bright regions in an image while ignoring small intensity variations.

example

BW = imextendedmax(I,H,conn) specifies the pixel connectivity conn to use to identify the connected components in the regional maxima.

Examples

collapse all

Read an image into the workspace.

I = imread("coins.png");

Visualize the image. Observe that the coins in the image represent regions that are significantly brighter than their surroundings.

figure
imshow(I)

Figure contains an axes object. The hidden axes object contains an object of type image.

Calculate the extended-maxima transform with a low value for H, the value that indicates the minimum height of regional maxima.

H = 20;
BWlow = imextendedmax(I,H);

Visualize the transformed image. Observe that the transform detects insignificant variations because the specified minimum height of regional maxima is low.

figure
imshow(BWlow)

Figure contains an axes object. The hidden axes object contains an object of type image.

Calculate the extended-maxima transform with a high value for H.

H = 150;
BWhigh = imextendedmax(I,H);

Visualize the transformed image. Observe that the transform ignores small intensity variations and detects entire regions that are significantly brighter than their surroundings because the specified minimum height of regional maxima is high.

figure
imshow(BWhigh)

Figure contains an axes object. The hidden axes object contains an object of type image.

Input Arguments

collapse all

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

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

Minimum height of regional maxima, specified as a nonnegative scalar. Specify a large value for H to identify only those regions in the image that are significantly brighter than their surroundings.

Example: 80

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

Pixel connectivity, specified as one of the values in this table. The default connectivity is 8 for 2-D images, and 26 for 3-D images.

Value

Meaning

Two-Dimensional Connectivities

4

Pixels are connected if their edges touch. The neighborhood of a pixel are the adjacent pixels in the horizontal or vertical direction.

3-by-3 pixel neighborhood with four pixels connected to the center pixel

Current pixel is shown in gray.

8

Pixels are connected if their edges or corners touch. The neighborhood of a pixel are the adjacent pixels in the horizontal, vertical, or diagonal direction.

3-by-3 pixel neighborhood with 8 pixels connected to the center pixel

Current pixel is shown in gray.

Three-Dimensional Connectivities

6

Pixels are connected if their faces touch. The neighborhood of a pixel are the adjacent pixels in:

  • One of these directions: in, out, left, right, up, and down

3-by-3-by-3 pixel neighborhood with 6 pixels connected to the faces of the center pixel

Current pixel is shown in gray.

18

Pixels are connected if their faces or edges touch. The neighborhood of a pixel are the adjacent pixels in:

  • One of these directions: in, out, left, right, up, and down

  • A combination of two directions, such as right-down or in-up

3-by-3-by-3 pixel neighborhood with 6 pixels connected to the faces and 12 pixels connected to the edges of the center pixel

Current pixel is center of cube.

26

Pixels are connected if their faces, edges, or corners touch. The neighborhood of a pixel are the adjacent pixels in:

  • One of these directions: in, out, left, right, up, and down

  • A combination of two directions, such as right-down or in-up

  • A combination of three directions, such as in-right-up or in-left-down

3-by-3-by-3 pixel neighborhood with 6 pixels connected to the faces, 12 pixels connected to the edges, and 8 pixels connected to the corners of the center pixel

Current pixel is center of cube.

For higher dimensions, imextendedmax uses the default value conndef(ndims(I),"maximal").

Connectivity can also be defined in a more general way for any dimension by specifying 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 about its center element. See Specifying Custom Connectivities for more information.

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

Output Arguments

collapse all

Transformed image, returned as a logical array the same size as I.

References

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

Extended Capabilities

expand all

Version History

Introduced before R2006a