Leptonica 1.68
C Image Processing Library

sel2.c File Reference

Contains definitions of simple structuring elements. More...

#include <stdio.h>
#include <math.h>
#include "allheaders.h"

Go to the source code of this file.

Defines

#define L_BUF_SIZE   512

Functions

SELAselaAddBasic (SELA *sela)
SELAselaAddHitMiss (SELA *sela)
SELAselaAddDwaLinear (SELA *sela)
SELAselaAddDwaCombs (SELA *sela)
SELAselaAddCrossJunctions (SELA *sela, l_float32 hlsize, l_float32 mdist, l_int32 norient, l_int32 debugflag)
SELAselaAddTJunctions (SELA *sela, l_float32 hlsize, l_float32 mdist, l_int32 norient, l_int32 debugflag)

Variables

static const l_int32 num_linear = 25
static const l_int32 basic_linear [] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 21, 25, 30, 31, 35, 40, 41, 45, 50, 51}

Detailed Description

Contains definitions of simple structuring elements.

    Contains definitions of simple structuring elements

        SELA    *selaAddBasic()
             Linear horizontal and vertical
             Square
             Diagonals

        SELA    *selaAddHitMiss()
             Isolated foreground pixel
             Horizontal and vertical edges
             Slanted edge

        SELA    *selaAddDwaLinear()
        SELA    *selaAddDwaCombs()
        SELA    *selaAddCrossJunctions()
        SELA    *selaAddTJunctions()

Definition in file sel2.c.


Define Documentation

#define L_BUF_SIZE   512

Function Documentation

SELA* selaAddBasic ( SELA sela)

selaAddBasic()

Input: sela (<optional>) Return: sela with additional sels, or null on error

Notes: (1) Adds the following sels:

  • all linear (horiz, vert) brick sels that are necessary for decomposable sels up to size 63
  • square brick sels up to size 10
  • 4 diagonal sels

Definition at line 65 of file sel2.c.

References basic_linear, Sel::cx, Sel::cy, ERROR_PTR, L_BUF_SIZE, NULL, num_linear, PROCNAME, selaAddSel(), selaCreate(), selCreate(), selCreateBrick(), selSetElement(), and size.

Referenced by main(), pixCloseBrickDwa(), pixDilateBrickDwa(), pixErodeBrickDwa(), and pixOpenBrickDwa().

SELA* selaAddHitMiss ( SELA sela)

selaAddHitMiss()

Input: sela (<optional>) Return: sela with additional sels, or null on error

Definition at line 153 of file sel2.c.

References ERROR_PTR, NULL, PROCNAME, selaAddSel(), selaCreate(), selCreateBrick(), and selSetElement().

Referenced by main().

SELA* selaAddDwaLinear ( SELA sela)

selaAddDwaLinear()

Input: sela (<optional>) Return: sela with additional sels, or null on error

Notes: (1) Adds all linear (horizontal, vertical) sels from 2 to 63 pixels in length, which are the sizes over which dwa code can be generated.

Definition at line 236 of file sel2.c.

References ERROR_PTR, L_BUF_SIZE, NULL, PROCNAME, selaAddSel(), selaCreate(), and selCreateBrick().

Referenced by main().

SELA* selaAddDwaCombs ( SELA sela)

selaAddDwaCombs()

Input: sela (<optional>) Return: sela with additional sels, or null on error

Notes: (1) Adds all comb (horizontal, vertical) Sels that are used in composite linear morphological operations up to 63 pixels in length, which are the sizes over which dwa code can be generated.

Definition at line 276 of file sel2.c.

References ERROR_PTR, L_BUF_SIZE, L_HORIZ, L_VERT, NULL, PROCNAME, selaAddSel(), selaCreate(), selectComposableSels(), selectComposableSizes(), and size.

Referenced by main().

SELA* selaAddCrossJunctions ( SELA sela,
l_float32  hlsize,
l_float32  mdist,
l_int32  norient,
l_int32  debugflag 
)

selaAddCrossJunctions()

Input: sela (<optional>) hlsize (length of each line of hits from origin) mdist (distance of misses from the origin) norient (number of orientations; max of 8) debugflag (1 for debug output) Return: sela with additional sels, or null on error

Notes: (1) Adds hitmiss Sels for the intersection of two lines. If the lines are very thin, they must be nearly orthogonal to register. (2) The number of Sels generated is equal to . (3) If == 2, this generates 2 Sels of crosses, each with two perpendicular lines of hits. One Sel has horizontal and vertical hits; the other has hits along lines at +-45 degrees. Likewise, if == 3, this generates 3 Sels of crosses oriented at 30 degrees with each other. (4) It is suggested that be chosen at least 1 greater than . Try values of (, ) such as (6,5), (7,6), (8,7), (9,7), etc.

Definition at line 333 of file sel2.c.

References ERROR_PTR, generatePtaLineFromPt(), IFF_PNG, L_BUF_SIZE, L_INSERT, L_MAX, L_SET_PIXELS, NULL, pixaAddPix(), pixaCreate(), pixaDestroy(), pixaDisplayTiledAndScaled(), pixaGetPixDimensions(), pixCreate(), pixDestroy(), pixDisplay(), pixPaintThroughMask(), pixRenderPta(), pixScaleBySampling(), pixSetAll(), pixSetPixel(), pixWriteTempfile(), PROCNAME, ptaDestroy(), ptaJoin(), selaAddSel(), selaCreate(), selaDisplayInPix(), selaWriteStream(), and selCreateFromColorPix().

SELA* selaAddTJunctions ( SELA sela,
l_float32  hlsize,
l_float32  mdist,
l_int32  norient,
l_int32  debugflag 
)

selaAddTJunctions()

Input: sela (<optional>) hlsize (length of each line of hits from origin) mdist (distance of misses from the origin) norient (number of orientations; max of 8) debugflag (1 for debug output) Return: sela with additional sels, or null on error

Notes: (1) Adds hitmiss Sels for the T-junction of two lines. If the lines are very thin, they must be nearly orthogonal to register. (2) The number of Sels generated is 4 * . (3) It is suggested that be chosen at least 1 greater than . Try values of (, ) such as (6,5), (7,6), (8,7), (9,7), etc.

Definition at line 455 of file sel2.c.

References ERROR_PTR, generatePtaLineFromPt(), IFF_PNG, L_BUF_SIZE, L_INSERT, L_MAX, L_SET_PIXELS, NULL, pixaAddPix(), pixaCreate(), pixaDestroy(), pixaDisplayTiledAndScaled(), pixaGetPixDimensions(), pixCreate(), pixDestroy(), pixDisplay(), pixPaintThroughMask(), pixRenderPta(), pixScaleBySampling(), pixSetAll(), pixSetPixel(), pixWriteTempfile(), PROCNAME, ptaDestroy(), ptaJoin(), selaAddSel(), selaCreate(), selaDisplayInPix(), selaWriteStream(), and selCreateFromColorPix().


Variable Documentation

const l_int32 num_linear = 25 [static]

Definition at line 47 of file sel2.c.

Referenced by selaAddBasic().

const l_int32 basic_linear[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 20, 21, 25, 30, 31, 35, 40, 41, 45, 50, 51} [static]

Definition at line 48 of file sel2.c.

Referenced by selaAddBasic().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines