Function iapatspec

namespace:morph
page:iapatspec

Synopse

Pattern spectrum (also known as granulometric size density).

  • h = iapatspec(f, type='OCTAGON', n=65535, Bc=ia_secross(NULL), Buser=ia_secross(NULL))
    • h: Image
    • f: Image
    • type: String Disk family: 'OCTAGON', 'CHESSBOARD', 'CITY-BLOCK', 'LINEAR-V', 'LINEAR-H', 'LINEAR-45R', 'LINEAR-45L', 'USER'.
    • n: Double Maximum disk radii.
    • Bc: Structuring Element Connectivity for the reconstructive granulometry. Used if '-REC' suffix is appended in the 'type' string.
    • Buser: Structuring Element User disk, used if 'type' is 'USER'.
01. from numpy import *
02. 
03. def iapatspec(f, type='OCTAGON', n=65535, Bc=None, Buser=None):
04.     from iaisbinary import iaisbinary
05.     from iaopentransf import iaopentransf
06.     from iahistogram import iahistogram
07.     from iasecross import iasecross
08.     if Bc is None:
09.         Bc = iasecross(None)
10.     if Buser is None:
11.         Buser = iasecross(None)
12. 
13.     assert iaisbinary(f),'Error: input image is not binary'
14.     g=iaopentransf(f,type,n,Bc,Buser)
15.     h=iahistogram(g)
16.     h=h[1:]
17.     return h

Description

Compute the Pattern Spectrum of a binary image. See

Examples

Equation