# mmareaclose
Area closing

## Synopsis

y = mmareaclose( f, a, Bc = None )

Implemented in Python.

### Input

f | Image Gray-scale (uint8 or uint16) or binary image.
a | Double non negative integer.
Bc | Structuring Element ( connectivity). Default: `None` (3x3 elementary cross)

### Output

y | Image Same type of `f`

## Description

mmareaclose removes any pore (i.e., background 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

Binary image:

    >>> a=mmreadgray('form-1.tif')

    >>> b=mmareaclose(a,400)

    >>> mmshow(a)

    >>> mmshow(b)

a | b |

Gray-scale image:

    >>> a=mmreadgray('n2538.tif')

    >>> b=mmareaclose(a,400)

    >>> mmshow(a)

    >>> mmshow(b)

a | b |

## Equation

## Limitations

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

## Source Code

    def mmareaclose(f, a, Bc=None):
        if Bc is None: Bc = mmsecross()
        y = mmneg(mmareaopen(mmneg(f),a,Bc))
        return y

## See also

mmareaopen | Area opening
mmlabel | Label a binary image.
mmsebox | Create a box structuring element.
mmsecross | Diamond structuring element and elementary 3x3 cross.
mmfreedom | Control automatic data type conversion.
mmclohole | Close holes of binary and gray-scale images.
mmregmin | Regional Minimum (with generalized dynamics).

[`mmclohole`] [Up] [`mmareaopen`] |
Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center.