# Documentation

### This is machine translation

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

# imextendedmax

Extended-maxima transform

## Syntax

``BW = imextendedmax(I,H)``
``BW = imextendedmax(I,H,conn)``

## Description

example

````BW = imextendedmax(I,H)` returns the extended-maxima transform for `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. `H` is a nonnegative scalar. By default, `imextendedmax` uses 8-connected neighborhoods for 2-D images and 26-connected neighborhoods for 3-D images. For higher dimensions, `imextendedmax` uses `conndef(numel(size(I)),'maximal')`.```
````BW = imextendedmax(I,H,conn)` computes the extended-maxima transform, where `conn` specifies the connectivity. ```

## Examples

collapse all

`I = imread('glass.png');`

Calculate the extended-maxima transform.

`BW = imextendedmax(I,80);`

Display original image and transformed image side-by-side.

`imshowpair(I,BW,'montage')`

## Input Arguments

collapse all

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

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

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

H-maxima transform, specified as a real, nonnegative scalar.

Example: `BW = imextendedmax(I,80);`

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, `imextendedmax` uses 8-connected neighborhoods for 2-D images and 26-connected neighborhoods for 3-D images. For higher dimensions, `imextendedmax` 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 `0`s and `1`s. 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: `BW = imextendedmax(I,80,4);`

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.