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

# MorphologicalReconstruction

Morphological filter

## SYNOPSIS

`#include "dip_morphology.h"`

dip_Error dip_MorphologicalReconstruction ( marker, mask, out, connectivity )

## DATA TYPES

integer, float

## FUNCTION

Dilation of the image `marker`, constrained by the image `mask`. `out` will be smaller or equal to `mask`. The image is grown according to the `connectivity` parameter. See The connectivity parameter for more information.

## ARGUMENTS

Data type | Name | Description
`dip_Image` | `marker` | Marker input image
`dip_Image` | `mask` | Mask input image
`dip_Image` | `out` | Output image
`dip_int` | `connectivity` | Connectivity

## KNOWN LIMITATIONS

The image `marker` is converted to the same data type as `mask`. If `mask` is an unsigned integer, and `marker` has negative values, then it is possible that these negative values will be turned into large positive values, yielding an unexpected output. The solution is to make sure that `mask` and `marker` are in compatible data types.

## LITERATURE

K. Robinson and P.F. Whelan, Efficient morphological reconstruction: a downhill filter, Pattern Recognition Letters 25(15):1759-1767, 2004.

## SEE ALSO

`Dilation`, `BinaryPropagation`, `AreaOpening`