DIPlib Documentation - ©1995-2005 Pattern Recognition Group, Delft University of Technology.

GrowRegions

Dilate the regions in a labelled image

SYNOPSIS

#include "dip_regions.h"

dip_Error dip_GrowRegions ( in, grey, mask, out, connectivity, iterations, order, method )

DATATYPES

in: binary, integer

grey: interger, float (converted to dip_sfloat)

mask: dip_uint8

FUNCTION

The regions in the input image in are grown with several options:

If grey is NULL, the regions are dilated iterations steps, according to connectivity (see The connectivity parameter), and optionally constrained by mask. This is the labelled equivalent to BinaryPropagation. If iterations is 0, the objects are dilated until no further change is possible. order and method are ignored.

If an image grey is given, the labels are grown in order of the grey-values in grey. order indicates whether pixels with high grey-values are added first or last. iterations is ignored, and mask is an optional constraint. This is a watershed algorithm with initial labels. The function Watershed does not accept an initial segmentation, so these two functions complement each other. Note that GrowRegions does not leave any watershed pixels in between the regions. method selects the method used to store and sort the pixels. For small 2D images it is better to use the stack (DIP_SORT_INSERTION_SORT). When the stack gets too large, this is very inneficient, and it's better to use the heap (DIP_SORT_HEAP_SORT). However, the latter is only good if the grey-value image does not have any plateaus. So if you use an integer grey-value image, try the stack. The value DIP_SORT_DEFAULT selects the more efficient heap.

ARGUMENTS

Data typeNameDescription
dip_ImageinInput binary or labelled image
dip_ImagegreyInput grey-value image
dip_ImagemaskMask image
dip_ImageoutOutput binary or labelled image
dip_intconnectivityConnectivity
dip_intiterationsNumber of iterations
dipf_GreyValueSortOrderorderWhether to grow from low to high or high to low
dip_SortTypemethodThe method used to store and sort the pixels

The dipf_GreyValueSortOrder enumeration consists of the following flags:

NameDescription
DIP_GVSO_HIGH_FIRSTProcess the pixels from high grey-value to low grey-value.
DIP_GVSO_LOW_FIRSTProcess the pixels from low grey-value to high grey-value.

SEE ALSO

GrowRegionsWeighted, Watershed, BinaryPropagation, Label

DIPlib on-line documentation | Function reference | Global function index