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

# Minima

Detects local minima

## SYNOPSIS

`#include "dip_filtering.h"`

dip_Error dip_Minima ( in, mask, out, connectivity, booleanOutput )

## DATA TYPES

integer, float

## FUNCTION

This function detects local minima.

The algorithm finds a connected set of pixels with identical value, an no neighbours with lower value. This set is a local minimum and its pixels are set to 1 in the output image. If `booleanOutput` is false, the output image is a labelled image.

This function differs from `LocalMinima` in that it marks every minimum. `LocalMinima` is able to filter out unimportant minima.

For images that have large plateaus (regions of constant value) that are not local minima, this function can be quite slow. For example, an image that is one everywhere except for a small valley somewhere. For such an image it is recommended to use the `mask` input, for example with the output of a threshold operation.

## ARGUMENTS

Data type | Name | Description
`dip_Image` | `in` | Input image
`dip_Image` | `mask` | Mask image
`dip_Image` | `out` | Binary output image
`dip_int` | `connectivity` | Connectivity
`dip_Boolean` | `booleanOutput` | Give a binary output image?

## NOTE

If you are looking for the old version of `Minima`, it is still available through the following combination of commands:

       dip_Erosion( in, out, se, boundary, param, shape );
       dip_Equal( in, out, out );

## SEE ALSO

`Maxima`, `SubpixelMinima`, `LocalMinima`, `SeededWatershed`, `GrowRegions`