# mmclohole
Close holes of binary and gray-scale images.

## Synopsis

y = mmclohole( f, Bc = None )

Implemented in Python.

### Input

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

### Output

y | Image (same datatype of `f`).

## Description

mmclohole creates the image `y` by closing the holes of the image `f`, according with the connectivity defined by the structuring element `Bc`.The images can be either binary or gray-scale.

## Examples

Binary image:

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

    >>> b = mmclohole(a)

    >>> mmshow(a)

    >>> mmshow(b)

a | b |

Gray-scale image:

    >>> a = mmreadgray('boxdrill-B.tif')

    >>> b = mmclohole(a)

    >>> mmshow(a)

    >>> mmshow(b)

a | b |

## Equation

## Source Code

    def mmclohole(f, Bc=None):
        if Bc is None: Bc = mmsecross()
        delta_f = mmframe(f)
        y = mmneg( mminfrec( delta_f, mmneg(f), Bc))
        return y

## See also

mmfreedom | Control automatic data type conversion.
mminfrec | Inf-reconstruction.
mmframe | Create a frame image.
mmsecross | Diamond structuring element and elementary 3x3 cross.
mmareaclose | Area closing

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