Leptonica 1.68
C Image Processing Library
|
Implements Sel (morph structuring element) and Sela (array of sel) More...
Go to the source code of this file.
Implements Sel (morph structuring element) and Sela (array of sel)
Basic ops on Sels and Selas Create/destroy/copy: SELA *selaCreate() void selaDestroy() SEL *selCreate() void selDestroy() SEL *selCopy() SEL *selCreateBrick() SEL *selCreateComb() Helper proc: l_int32 **create2dIntArray() Extension of sela: SELA *selaAddSel() l_int32 selaExtendArray() Accessors: l_int32 selaGetCount() SEL *selaGetSel() char *selGetName() l_int32 selSetName() l_int32 selaFindSelByName() l_int32 selGetElement() l_int32 selSetElement() l_int32 selGetParameters() l_int32 selSetOrigin() l_int32 selGetTypeAtOrigin() char *selaGetBrickName() char *selaGetCombName() static char *selaComputeCompositeParameters() l_int32 getCompositeParameters() SARRAY *selaGetSelnames() Max translations for erosion and hmt l_int32 selFindMaxTranslations() Rotation by multiples of 90 degrees SEL *selRotateOrth() Sela and Sel serialized I/O SELA *selaRead() SELA *selaReadStream() SEL *selRead() SEL *selReadStream() l_int32 selaWrite() l_int32 selaWriteStream() l_int32 selWrite() l_int32 selWriteStream() Building custom hit-miss sels from compiled strings SEL *selCreateFromString() char *selPrintToString() [for debugging] Building custom hit-miss sels from a simple file format SELA *selaCreateFromFile() static SEL *selCreateFromSArray() Making hit-only sels from Pta and Pix SEL *selCreateFromPta() SEL *selCreateFromPix() Making hit-miss sels from Pix and image files SEL *selReadFromColorImage() SEL *selCreateFromColorPix() Printable display of sel PIX *selDisplayInPix() PIX *selaDisplayInPix() Usage notes: In this file we have seven functions that make sels: (1) selCreate(), with input (h, w, [name]) The generic function. Roll your own, using selSetElement(). (2) selCreateBrick(), with input (h, w, cy, cx, val) The most popular function. Makes a rectangular sel of all hits, misses or don't-cares. We have many morphology operations that create a sel of all hits, use it, and destroy it. (3) selCreateFromString() with input (text, h, w, [name]) Adam Langley's clever function, allows you to make a hit-miss sel from a string in code that is geometrically laid out just like the actual sel. (4) selaCreateFromFile() with input (filename) This parses a simple file format to create an array of hit-miss sels. The sel data uses the same encoding as in (3), with geometrical layout enforced. (5) selCreateFromPta() with input (pta, cy, cx, [name]) Another way to make a sel with only hits. (6) selCreateFromPix() with input (pix, cy, cx, [name]) Yet another way to make a sel from hits. (7) selCreateFromColorPix() with input (pix, name). Another way to make a general hit-miss sel, starting with an image editor. In addition, there are three functions in selgen.c that automatically generate a hit-miss sel from a pix and a number of parameters. This is useful for problems like "find all patterns that look like this one." Consistency, being the hobgoblin of small minds, is adhered to here in the dimensioning and accessing of sels. Everything is done in standard matrix (row, column) order. When we set specific elements in a sel, we likewise use (row, col) ordering: selSetElement(), with input (row, col, type)
Definition in file sel1.c.
#define L_BUF_SIZE 256 |
Definition at line 133 of file sel1.c.
Referenced by selaGetCombName(), and selReadStream().
Input: sa first (line of sarray where Sel begins) last (line of sarray where Sel ends) Return: sela, or null on error
Notes: (1) The Sel contains the following lines:
Definition at line 1796 of file sel1.c.
References ERROR_PTR, L_NOCOPY, NULL, PROCNAME, sarrayGetCount(), sarrayGetString(), SEL_DONT_CARE, SEL_HIT, SEL_MISS, selCreate(), selDestroy(), selSetElement(), and selSetOrigin().
Referenced by selaCreateFromFile().
Input: n (initial number of sel ptrs; use 0 for default) Return: sela, or null on error
Definition at line 227 of file sel1.c.
References CALLOC, ERROR_PTR, INITIAL_PTR_ARRAYSIZE, L_WARNING_INT, MANY_SELS, Sela::n, Sela::nalloc, NULL, PROCNAME, and Sela::sel.
Referenced by main(), pixThin(), pixThinExamples(), selaAddBasic(), selaAddCrossJunctions(), selaAddDwaCombs(), selaAddDwaLinear(), selaAddHitMiss(), selaAddTJunctions(), selaCreateFromFile(), and selaReadStream().
void selaDestroy | ( | SELA ** | psela | ) |
Input: &sela (<to be="" nulled>="">) Return: void
Definition at line 259 of file sel1.c.
References FREE, Sela::n, NULL, Sela::sel, and selDestroy().
Referenced by main(), pixCloseBrickDwa(), pixDilateBrickDwa(), pixErodeBrickDwa(), pixOpenBrickDwa(), pixThin(), pixThinExamples(), and selaCreateFromFile().
Input: height, width name (<optional> sel name; can be null) Return: sel, or null on error
Notes: (1) selCreate() initializes all values to 0. (2) After this call, (cy,cx) and nonzero data values must be assigned. If a text name is not assigned here, it will be needed later when the sel is put into a sela.
Definition at line 291 of file sel1.c.
References CALLOC, create2dIntArray(), Sel::data, ERROR_PTR, Sel::name, NULL, PROCNAME, stringNew(), Sel::sx, and Sel::sy.
Referenced by selaAddBasic(), selCreateBrick(), selCreateComb(), selCreateFromColorPix(), selCreateFromPix(), selCreateFromPta(), selCreateFromSArray(), selCreateFromString(), and selReadStream().
void selDestroy | ( | SEL ** | psel | ) |
Input: &sel (<to be="" nulled>="">) Return: void
Definition at line 319 of file sel1.c.
References Sel::data, FREE, L_WARNING, Sel::name, NULL, PROCNAME, and Sel::sy.
Referenced by GeneratePattern(), jbClassifyRankHaus(), main(), pixCloseBrick(), pixCloseCompBrick(), pixCloseSafeBrick(), pixCloseSafeCompBrick(), pixDilateBrick(), pixDilateCompBrick(), pixErodeBrick(), pixErodeCompBrick(), pixGenerateSelBoundary(), pixGenerateSelRandom(), pixGenerateSelWithRuns(), pixItalicWords(), pixMirrorDetect(), pixOpenBrick(), pixOpenCompBrick(), pixRemoveMatchedPattern(), pixRunHistogramMorph(), pixSeedfillMorph(), pixThinGeneral(), pixUpDownDetectGeneral(), pixWordMaskByDilation(), selaDestroy(), selCreateFromColorPix(), selCreateFromSArray(), and selCreateFromString().
Input: sel Return: a copy of the sel, or null on error
Definition at line 352 of file sel1.c.
References CALLOC, create2dIntArray(), Sel::cx, Sel::cy, Sel::data, ERROR_PTR, Sel::name, NULL, PROCNAME, selGetParameters(), stringNew(), Sel::sx, and Sel::sy.
Referenced by selaAddSel(), and selRotateOrth().
Input: height, width cy, cx (origin, relative to UL corner at 0,0) type (SEL_HIT, SEL_MISS, or SEL_DONT_CARE) Return: sel, or null on error
Notes: (1) This is a rectangular sel of all hits, misses or don't cares.
Definition at line 396 of file sel1.c.
References Sel::data, ERROR_PTR, NULL, PROCNAME, SEL_DONT_CARE, SEL_HIT, SEL_MISS, selCreate(), and selSetOrigin().
Referenced by jbClassifyRankHaus(), main(), pixCloseBrick(), pixCloseSafeBrick(), pixDilateBrick(), pixErodeBrick(), pixGenerateSelBoundary(), pixGenerateSelRandom(), pixGenerateSelWithRuns(), pixOpenBrick(), pixRemoveMatchedPattern(), pixRunHistogramMorph(), pixSeedfillMorph(), pixWordMaskByDilation(), selaAddBasic(), selaAddDwaLinear(), selaAddHitMiss(), selectComposableSels(), and selRotateOrth().
Input: factor1 (contiguous space between comb tines) factor2 (number of comb tines) direction (L_HORIZ, L_VERT) Return: sel, or null on error
Notes: (1) This generates a comb Sel of hits with the origin as near the center as possible.
Definition at line 436 of file sel1.c.
References ERROR_PTR, L_HORIZ, L_VERT, NULL, PROCNAME, SEL_HIT, selCreate(), selSetElement(), selSetOrigin(), and size.
Referenced by selectComposableSels().
Input: sy (rows == height) sx (columns == width) Return: doubly indexed array (i.e., an array of sy row pointers, each of which points to an array of sx ints)
Notes: (1) The array[sy][sx] is indexed in standard "matrix notation", with the row index first.
Definition at line 490 of file sel1.c.
References CALLOC, ERROR_PTR, NULL, and PROCNAME.
Referenced by selCopy(), and selCreate().
Input: sela sel to be added selname (ignored if already defined in sel; req'd in sel when added to a sela) copyflag (for sel: 0 inserts, 1 copies) Return: 0 if OK; 1 on error
Notes: (1) This adds a sel, either inserting or making a copy. (2) Because every sel in a sela must have a name, it copies the input name if necessary. You can input NULL for selname if the sel already has a name.
Definition at line 531 of file sel1.c.
References ERROR_INT, Sela::n, Sela::nalloc, Sel::name, NULL, PROCNAME, Sela::sel, selaExtendArray(), selaGetCount(), selCopy(), stringNew(), and TRUE.
Referenced by main(), pixThin(), pixThinExamples(), selaAddBasic(), selaAddCrossJunctions(), selaAddDwaCombs(), selaAddDwaLinear(), selaAddHitMiss(), selaAddTJunctions(), selaCreateFromFile(), and selaReadStream().
Input: sela Return: 0 if OK; 1 on error
Definition at line 574 of file sel1.c.
References ERROR_INT, Sela::nalloc, NULL, PROCNAME, reallocNew(), and Sela::sel.
Referenced by selaAddSel().
Input: sela Return: count, or 0 on error
Definition at line 602 of file sel1.c.
References ERROR_INT, Sela::n, and PROCNAME.
Referenced by fhmtautogen1(), fhmtautogen2(), fmorphautogen1(), fmorphautogen2(), main(), pixIntersectionOfMorphOps(), pixThinGeneral(), pixUnionOfMorphOps(), selaAddSel(), selaDisplayInPix(), selaFindSelByName(), selaGetBrickName(), selaGetCombName(), selaGetSelnames(), and selaWriteStream().
Input: sela index of sel to be retrieved (not copied) Return: sel, or null on error
Notes: (1) This returns a ptr to the sel, not a copy, so the caller must not destroy it!
Definition at line 625 of file sel1.c.
References ERROR_PTR, Sela::n, NULL, PROCNAME, and Sela::sel.
Referenced by fhmtautogen2(), fmorphautogen2(), main(), pixIntersectionOfMorphOps(), pixThinGeneral(), pixUnionOfMorphOps(), selaDisplayInPix(), selaFindSelByName(), selaGetBrickName(), selaGetCombName(), selaGetSelnames(), and selaWriteStream().
char* selGetName | ( | SEL * | sel | ) |
Input: sel Return: sel name (not copied), or null if no name or on error
Definition at line 646 of file sel1.c.
References ERROR_PTR, Sel::name, NULL, and PROCNAME.
Referenced by main(), selaFindSelByName(), selaGetBrickName(), selaGetCombName(), selaGetSelnames(), and selWriteStream().
Input: sel name (<optional>; can be null) Return: 0 if OK, 1 on error
Notes: (1) Always frees the existing sel name, if defined. (2) If name is not defined, just clears any existing sel name.
Definition at line 669 of file sel1.c.
References ERROR_INT, Sel::name, PROCNAME, and stringReplace().
Referenced by selCreateFromColorPix().
Input: sela sel name &index (<optional, return>) &sel (<optional, return> sel (not a copy)) Return: 0 if OK; 1 on error
Definition at line 691 of file sel1.c.
References ERROR_INT, L_WARNING, NULL, PROCNAME, selaGetCount(), selaGetSel(), and selGetName().
Referenced by main().
Input: sel row col &type (<return> SEL_HIT, SEL_MISS, SEL_DONT_CARE) Return: 0 if OK; 1 on error
Definition at line 740 of file sel1.c.
References Sel::data, ERROR_INT, PROCNAME, SEL_DONT_CARE, Sel::sx, and Sel::sy.
Referenced by pixDisplayHitMissSel(), selDisplayInPix(), selGetTypeAtOrigin(), selPrintToString(), and selRotateOrth().
Input: sel row col type (SEL_HIT, SEL_MISS, SEL_DONT_CARE) Return: 0 if OK; 1 on error
Notes: (1) Because we use row and column to index into an array, they are always non-negative. The location of the origin (and the type of operation) determine the actual direction of the rasterop.
Definition at line 778 of file sel1.c.
References Sel::data, ERROR_INT, PROCNAME, SEL_DONT_CARE, SEL_HIT, SEL_MISS, Sel::sx, and Sel::sy.
Referenced by pixGenerateSelBoundary(), pixGenerateSelRandom(), pixGenerateSelWithRuns(), pixSeedfillMorph(), selaAddBasic(), selaAddHitMiss(), selCreateComb(), selCreateFromColorPix(), selCreateFromPix(), selCreateFromPta(), selCreateFromSArray(), selCreateFromString(), and selRotateOrth().
Input: sel &sy, &sx, &cy, &cx (<optional return>="">; each can be null) Return: 0 if OK, 1 on error
Definition at line 807 of file sel1.c.
References Sel::cx, Sel::cy, ERROR_INT, PROCNAME, Sel::sx, and Sel::sy.
Referenced by GeneratePattern(), main(), pixDilate(), pixErode(), pixHMT(), processMorphArgs1(), processMorphArgs2(), selaGetBrickName(), selaGetCombName(), selCopy(), selDisplayInPix(), selFindMaxTranslations(), selGetTypeAtOrigin(), selPrintToString(), selRotateOrth(), and selWriteStream().
Input: sel cy, cx Return: 0 if OK; 1 on error
Definition at line 837 of file sel1.c.
References Sel::cx, Sel::cy, ERROR_INT, and PROCNAME.
Referenced by selCreateBrick(), selCreateComb(), selCreateFromColorPix(), selCreateFromPix(), selCreateFromPta(), selCreateFromSArray(), selCreateFromString(), and selReadStream().
Input: sel &type (<return> SEL_HIT, SEL_MISS, SEL_DONT_CARE) Return: 0 if OK; 1 on error or if origin is not found
Definition at line 859 of file sel1.c.
References ERROR_INT, PROCNAME, SEL_DONT_CARE, selGetElement(), and selGetParameters().
Referenced by selDisplayInPix().
Input: sela hsize, vsize (of brick sel) Return: sel name (new string), or null if no name or on error
Definition at line 894 of file sel1.c.
References ERROR_PTR, NULL, PROCNAME, selaGetCount(), selaGetSel(), selGetName(), selGetParameters(), and stringNew().
Referenced by main(), pixCloseBrickDwa(), pixDilateBrickDwa(), pixErodeBrickDwa(), and pixOpenBrickDwa().
Input: sela size (the product of sizes of the brick and comb parts) direction (L_HORIZ, L_VERT) Return: sel name (new string), or null if name not found or on error
Notes: (1) Combs are by definition 1-dimensional, either horiz or vert. (2) Use this with comb Sels; e.g., from selaAddDwaCombs().
Definition at line 931 of file sel1.c.
References ERROR_PTR, FALSE, L_BUF_SIZE, L_HORIZ, L_VERT, NULL, PROCNAME, selaGetCount(), selaGetSel(), selGetName(), selGetParameters(), stringNew(), and TRUE.
l_int32 getCompositeParameters | ( | l_int32 | size, |
l_int32 * | psize1, | ||
l_int32 * | psize2, | ||
char ** | pnameh1, | ||
char ** | pnameh2, | ||
char ** | pnamev1, | ||
char ** | pnamev2 | ||
) |
Input: size &size1 (<optional return>=""> brick factor size) &size2 (<optional return>=""> comb factor size) &nameh1 (<optional return>=""> name of horiz brick) &nameh2 (<optional return>=""> name of horiz comb) &namev1 (<optional return>=""> name of vert brick) &namev2 (<optional return>=""> name of vert comb) Return: 0 if OK, 1 on error
Notes: (1) This uses the big lookup table at the top of this file. (2) All returned strings are copies that must be freed.
Definition at line 1056 of file sel1.c.
References ERROR_INT, NULL, PROCNAME, CompParameterMap::selnameh1, CompParameterMap::selnameh2, CompParameterMap::selnamev1, CompParameterMap::selnamev2, CompParameterMap::size1, CompParameterMap::size2, and stringNew().
Referenced by pixCloseCompBrickDwa(), pixDilateCompBrickDwa(), pixErodeCompBrickDwa(), and pixOpenCompBrickDwa().
Input: sela Return: sa (of all sel names), or null on error
Definition at line 1100 of file sel1.c.
References ERROR_PTR, NULL, PROCNAME, sarrayAddString(), sarrayCreate(), selaGetCount(), selaGetSel(), and selGetName().
Referenced by fhmtautogen1(), and fmorphautogen1().
l_int32 selFindMaxTranslations | ( | SEL * | sel, |
l_int32 * | pxp, | ||
l_int32 * | pyp, | ||
l_int32 * | pxn, | ||
l_int32 * | pyn | ||
) |
Input: sel &xp, &yp, &xn, &yn (<return> max shifts) Return: 0 if OK; 1 on error
Note: these are the maximum shifts for the erosion operation. For example, when j < cx, the shift of the image is +x to the cx. This is a positive xp shift.
Definition at line 1142 of file sel1.c.
References Sel::data, ERROR_INT, L_MAX, PROCNAME, and selGetParameters().
Referenced by pixCloseSafe(), pixErode(), and pixHMT().
Input: sel quads (0 - 4; number of 90 degree cw rotations) Return: seld, or null on error
Definition at line 1192 of file sel1.c.
References ERROR_PTR, Sel::name, NULL, PROCNAME, SEL_DONT_CARE, selCopy(), selCreateBrick(), selGetElement(), selGetParameters(), selSetElement(), and stringNew().
Referenced by main(), pixThinExamples(), and pixThinGeneral().
SELA* selaRead | ( | const char * | fname | ) |
Input: filename Return: sela, or null on error
Definition at line 1259 of file sel1.c.
References ERROR_PTR, fopenReadStream(), NULL, PROCNAME, and selaReadStream().
Referenced by main().
SELA* selaReadStream | ( | FILE * | fp | ) |
Input: stream Return: sela, or null on error
Definition at line 1286 of file sel1.c.
References ERROR_PTR, Sela::nalloc, NULL, PROCNAME, SEL_VERSION_NUMBER, selaAddSel(), selaCreate(), selReadStream(), and version.
Referenced by selaRead().
SEL* selRead | ( | const char * | fname | ) |
Input: filename Return: sel, or null on error
Definition at line 1326 of file sel1.c.
References ERROR_PTR, fopenReadStream(), NULL, PROCNAME, and selReadStream().
SEL* selReadStream | ( | FILE * | fp | ) |
Input: stream Return: sel, or null on error
Definition at line 1353 of file sel1.c.
References Sel::data, ERROR_PTR, FREE, L_BUF_SIZE, NULL, PROCNAME, SEL_VERSION_NUMBER, selCreate(), selSetOrigin(), stringNew(), and version.
Referenced by selaReadStream(), and selRead().
Input: filename sela Return: 0 if OK, 1 on error
Definition at line 1404 of file sel1.c.
References ERROR_INT, fopenWriteStream(), NULL, PROCNAME, and selaWriteStream().
Referenced by main().
Input: stream sela Return: 0 if OK, 1 on error
Definition at line 1433 of file sel1.c.
References ERROR_INT, NULL, PROCNAME, SEL_VERSION_NUMBER, selaGetCount(), selaGetSel(), and selWriteStream().
Referenced by selaAddCrossJunctions(), selaAddTJunctions(), and selaWrite().
Input: filename sel Return: 0 if OK, 1 on error
Definition at line 1466 of file sel1.c.
References ERROR_INT, fopenWriteStream(), NULL, PROCNAME, and selWriteStream().
Input: stream sel Return: 0 if OK, 1 on error
Definition at line 1495 of file sel1.c.
References Sel::data, ERROR_INT, PROCNAME, SEL_VERSION_NUMBER, selGetName(), and selGetParameters().
Referenced by main(), selaWriteStream(), and selWrite().
Input: text height, width name (<optional> sel name; can be null) Return: sel of the given size, or null on error
Notes: (1) The text is an array of chars (in row-major order) where each char can be one of the following: 'x': hit 'o': miss ' ': don't-care (2) Use an upper case char to indicate the origin of the Sel. When the origin falls on a don't-care, use 'C' as the uppecase for ' '. (3) The text can be input in a format that shows the 2D layout; e.g., static const char *seltext = "x " "x Oo " "x " "xxxxx";
Definition at line 1550 of file sel1.c.
References ERROR_PTR, NULL, PROCNAME, SEL_DONT_CARE, SEL_HIT, SEL_MISS, selCreate(), selDestroy(), selSetElement(), and selSetOrigin().
Referenced by main(), pixItalicWords(), pixMirrorDetect(), pixThin(), pixThinExamples(), and pixUpDownDetectGeneral().
char* selPrintToString | ( | SEL * | sel | ) |
Input: sel Return: str (string; caller must free)
Notes: (1) This is an inverse function of selCreateFromString. It prints a textual representation of the SEL to a malloc'd string. The format is the same as selCreateFromString except that newlines are inserted into the output between rows. (2) This is useful for debugging. However, if you want to save some Sels in a file, put them in a Sela and write them out with selaWrite(). They can then be read in with selaRead().
Definition at line 1624 of file sel1.c.
References CALLOC, ERROR_PTR, NULL, PROCNAME, SEL_DONT_CARE, SEL_HIT, SEL_MISS, selGetElement(), and selGetParameters().
Referenced by main().
SELA* selaCreateFromFile | ( | const char * | filename | ) |
Input: filename Return: sela, or null on error
Notes: (1) The file contains a sequence of Sel descriptions. (2) Each Sel is formatted as follows:
Definition at line 1697 of file sel1.c.
References ERROR_PTR, FALSE, FREE, l_binaryRead(), L_NOCOPY, NULL, numaAddNumber(), numaCreate(), numaDestroy(), numaGetCount(), numaGetIValue(), PROCNAME, sarrayCreateLinesFromString(), sarrayDestroy(), sarrayGetCount(), sarrayGetString(), selaAddSel(), selaCreate(), selaDestroy(), selCreateFromSArray(), and TRUE.
Referenced by main().
Input: pta cy, cx (origin of sel) name (<optional> sel name; can be null) Return: sel (of minimum required size), or null on error
Notes: (1) The origin and all points in the pta must be positive.
Definition at line 1872 of file sel1.c.
References boxDestroy(), boxGetGeometry(), ERROR_PTR, NULL, PROCNAME, ptaGetBoundingRegion(), ptaGetCount(), ptaGetIPt(), SEL_HIT, selCreate(), selSetElement(), and selSetOrigin().
Input: pix cy, cx (origin of sel) name (<optional> sel name; can be null) Return: sel, or null on error
Notes: (1) The origin must be positive.
Definition at line 1920 of file sel1.c.
References ERROR_PTR, NULL, pixGetDimensions(), pixGetPixel(), PROCNAME, SEL_HIT, selCreate(), selSetElement(), and selSetOrigin().
SEL* selReadFromColorImage | ( | const char * | pathname | ) |
Input: pathname Return: sel if OK; null on error
Notes: (1) Loads an image from a file and creates a (hit-miss) sel. (2) The sel name is taken from the pathname without the directory and extension.
Definition at line 1969 of file sel1.c.
References ERROR_PTR, FREE, NULL, pixDestroy(), pixRead(), PROCNAME, selCreateFromColorPix(), splitPathAtDirectory(), and splitPathAtExtension().
Input: pixs (cmapped or rgb) selname (<optional> sel name; can be null) Return: sel if OK, null on error
Notes: (1) The sel size is given by the size of pixs. (2) In pixs, hits are represented by green pixels, misses by red pixels, and don't-cares by white pixels. (3) In pixs, there may be no misses, but there must be at least 1 hit. (4) At most there can be only one origin pixel, which is optionally specified by using a lower-intensity pixel: if a hit: dark green if a miss: dark red if a don't care: gray If there is no such pixel, the origin defaults to the approximate center of the sel.
Definition at line 2014 of file sel1.c.
References COLOR_BLUE, COLOR_GREEN, COLOR_RED, ERROR_PTR, FALSE, GET_DATA_BYTE, L_WARNING, NULL, pixcmapGetColor(), pixcmapHasColor(), pixGetColormap(), pixGetDimensions(), pixGetPixel(), PROCNAME, SEL_DONT_CARE, SEL_HIT, SEL_MISS, selCreate(), selDestroy(), selSetElement(), selSetName(), selSetOrigin(), and TRUE.
Referenced by selaAddCrossJunctions(), selaAddTJunctions(), and selReadFromColorImage().
Input: sel size (of grid interiors; odd; minimum size of 13 is enforced) gthick (grid thickness; minimum size of 2 is enforced) Return: pix (display of sel), or null on error
Notes: (1) This gives a visual representation of a general (hit-miss) sel. (2) The empty sel is represented by a grid of intersecting lines. (3) Three different patterns are generated for the sel elements:
Definition at line 2104 of file sel1.c.
References ERROR_PTR, generatePtaFilledCircle(), L_FLIP_PIXELS, L_SET_PIXELS, L_WARNING, NULL, PIX_DST, PIX_NOT, PIX_SRC, pixCreate(), pixDestroy(), pixGenerateFromPta(), pixRasterop(), pixRenderLine(), pixSubtract(), pixXor(), PROCNAME, ptaDestroy(), ptaTransform(), SEL_HIT, SEL_MISS, selGetElement(), selGetParameters(), selGetTypeAtOrigin(), x0, and y0.
Referenced by main(), and selaDisplayInPix().
Input: sela size (of grid interiors; odd; minimum size of 13 is enforced) gthick (grid thickness; minimum size of 2 is enforced) spacing (between sels, both horizontally and vertically) ncols (number of sels per "line") Return: pix (display of all sels in sela), or null on error
Notes: (1) This gives a visual representation of all the sels in a sela. (2) See notes in selDisplayInPix() for display params of each sel. (3) This gives the nicest results when all sels in the sela are the same size.
Definition at line 2220 of file sel1.c.
References ERROR_PTR, L_CLONE, L_INSERT, L_MIN, L_WARNING, ncols, NULL, pixaAddPix(), pixaCreate(), pixaDestroy(), pixaDisplayTiledInRows(), pixaGetPix(), pixDestroy(), pixGetDimensions(), PROCNAME, selaGetCount(), selaGetSel(), and selDisplayInPix().
Referenced by main(), pixThinExamples(), pixThinGeneral(), selaAddCrossJunctions(), and selaAddTJunctions().
const l_int32 INITIAL_PTR_ARRAYSIZE = 50 [static] |
Definition at line 135 of file sel1.c.
Referenced by selaCreate().
Definition at line 136 of file sel1.c.
Referenced by selaCreate().
struct CompParameterMap comp_parameter_map[] [static] |