DIPlib Documentation - ©1995-2015 Quantitative Imaging Group, Delft University of Technology.

# LocalMinima

Marks local minima (or regional minima)

## SYNOPSIS

`#include "dip_morphology.h"`

dip_Error dip_LocalMinima ( in, mask, out, connectivity, max_depth, max_size, binaryOutput )

## DATA TYPES

integer, float

## FUNCTION

The binary output image is true on all pixels belonging to the minima of a region (as defined by the watershed). To find local maxima, use the inverse of the image as input to this function (see `Invert`). If `binaryOutput` is `DIP_FALSE`, the output is a labelled image instead of a binary one. In this case, pixels belonging to the same local minimum are assigned the same value.

The algorithm is based on the watershed transform, see `Watershed` for information on the parameters.

`Minima` is a different algorithm to obtain local minima; `Maxima` yields the local maxima.

## ARGUMENTS

Data type | Name | Description
`dip_Image` | `in` | Input
`dip_Image` | `mask` | Mask
`dip_Image` | `out` | Output (binary)
`dip_int` | `connectivity` | Connectivity
`dip_float` | `max_depth` | Maximum depth of a region that can be merged
`dip_int` | `max_size` | Maximum size of a region that can be merged
`dip_Boolean` | `binaryOutput` | `DIP_FALSE` if the output should be a labelled image

## SEE ALSO

`Watershed`, `SeededWatershed`, `UpperEnvelope`, `Minima`, `Maxima`