[mmAreaclose] [Up] [mmVmin] Connected Operators

mmAreaopen
Area opening

Synopsis

Image mmAreaopen ( const Image& f , const Double& a , const Strel& Bc = NullStrel );

Input

f Image [ Gray-scale (uint8 or uint16) or binary image ]

a Double

non negative integer.

Bc Structuring Element

( connectivity).

Default: NullStrel (3x3 elementary cross)

Output

y Image

Same type of f

Description

mmAreaopen removes any grain (i.e., connected component) with area less than a of a binary image f. The connectivity is given by the structuring element Bc. This operator is generalized to gray-scale images by applying the binary operator successively on slices of f taken from higher threshold levels to lower threshold levels.

Examples

Numerical examples:

unsigned char _f[] = {1, 1, 0, 0, 0, 0, 1, 
                      1, 0, 1, 1, 1, 0, 1, 
                      0, 0, 0, 0, 1, 0, 0};
Image f = Image(7, 3, 1, "binary", (char *)_f);
Image y = mmAreaopen(f, 4, mmSecross());
printf("y =\n%s\n", (char *)y.str()); 

y =
    0 0 0 0 0 0 0 
    0 0 1 1 1 0 0 
    0 0 0 0 1 0 0

Binary image
Gray-scale image

Equation

Limitations

The structuring elements allowed are the elementary cross (4-connected) and the elementary box (8-connected).

See also

mmLabel Label a binary image.
mmSebox Create a box structuring element.
mmSecross Diamond structuring element and elementary 3x3 cross.
mmAreaclose Area closing
[mmAreaclose] [Up] [mmVmin]