# mmpatspec
Pattern spectrum (also known as granulometric size density).

## Synopsis

h = mmpatspec( f, type = 'OCTAGON', n = 65535, Bc = None, Buser = None )

Implemented in Python.

### Input

f | Image Binary image.
type | String Disk family: 'OCTAGON', 'CHESSBOARD', 'CITY-BLOCK', 'LINEAR-V', 'LINEAR-H', 'LINEAR-45R', 'LINEAR-45L', 'USER'. Default: `'OCTAGON'`
n | Double Maximum disk radii. Default: `65535`
Bc | Structuring Element Connectivity for the reconstructive granulometry. Used if '-REC' suffix is appended in the 'type' string. Default: `None` (3x3 elementary cross)
Buser | Structuring Element User disk, used if 'type' is 'USER'. Default: `None` (3x3 elementary cross)

### Output

h | Image Gray-scale (uint8 or uint16) or binary image. a `uint16` vector.

## Description

Compute the Pattern Spectrum of a binary image. See Mara:89b. The pattern spectrum is the histogram of the open transform, not taking the zero values.

## Equation

## Source Code

    def mmpatspec(f, type='OCTAGON', n=65535, Bc=None, Buser=None):
        if Bc is None: Bc = mmsecross()
        if Buser is None: Buser = mmsecross()
        assert mmisbinary(f),'Error: input image is not binary'
        g=mmopentransf(f,type,n,Bc,Buser)
        h=mmhistogram(g)
        h=h[1:]
        return h

## See also

mmopen | Morphological opening.
mmopentransf | Open transform.
mmsedisk | Create a disk or a semi-sphere structuring element.

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