87 #include <config_auto.h>
90 #include "allheaders.h"
93 #define SWAP(x, y) {temp = (x); (x) = (y); (y) = temp;}
118 return (
PIX *)ERROR_PTR(
"pixs not defined", __func__, NULL);
152 const char *sequence,
158 return (
PIX *)ERROR_PTR(
"pixs not defined", __func__, NULL);
160 return (
PIX *)ERROR_PTR(
"sequence not defined", __func__, NULL);
196 const char *sequence,
197 l_int32 connectivity,
202 l_int32 n, i, x, y, w, h;
208 return (
PIX *)ERROR_PTR(
"pixs not defined", __func__, NULL);
210 return (
PIX *)ERROR_PTR(
"sequence not defined", __func__, NULL);
212 if (minw <= 0) minw = 1;
213 if (minh <= 0) minh = 1;
216 if ((boxa =
pixConnComp(pixs, &pixas, connectivity)) == NULL)
217 return (
PIX *)ERROR_PTR(
"boxa not made", __func__, NULL);
224 return (
PIX *)ERROR_PTR(
"pixad not made", __func__, NULL);
229 for (i = 0; i < n; i++) {
264 const char *sequence,
268 l_int32 n, i, w, h, d;
274 return (
PIXA *)ERROR_PTR(
"pixas not defined", __func__, NULL);
276 return (
PIXA *)ERROR_PTR(
"no pix in pixas", __func__, NULL);
278 L_WARNING(
"boxa size != n\n", __func__);
281 return (
PIXA *)ERROR_PTR(
"depth not 1 bpp", __func__, NULL);
284 return (
PIXA *)ERROR_PTR(
"sequence not defined", __func__, NULL);
285 if (minw <= 0) minw = 1;
286 if (minh <= 0) minh = 1;
289 return (
PIXA *)ERROR_PTR(
"pixad not made", __func__, NULL);
290 for (i = 0; i < n; i++) {
292 if (w >= minw && h >= minh) {
295 return (
PIXA *)ERROR_PTR(
"pix1 not found", __func__, NULL);
299 return (
PIXA *)ERROR_PTR(
"pix2 not made", __func__, NULL);
346 const char *sequence,
347 l_int32 connectivity,
352 l_int32 n, i, x, y, w, h;
357 if (pboxa) *pboxa = NULL;
359 return (
PIX *)ERROR_PTR(
"pixs not defined", __func__, NULL);
361 return (
PIX *)ERROR_PTR(
"pixm not defined", __func__, NULL);
362 if (pixGetDepth(pixs) != 1 || pixGetDepth(pixm) != 1)
363 return (
PIX *)ERROR_PTR(
"pixs and pixm not both 1 bpp", __func__, NULL);
365 return (
PIX *)ERROR_PTR(
"sequence not defined", __func__, NULL);
367 if (minw <= 0) minw = 1;
368 if (minh <= 0) minh = 1;
371 if ((boxa =
pixConnComp(pixm, &pixam, connectivity)) == NULL)
372 return (
PIX *)ERROR_PTR(
"boxa not made", __func__, NULL);
379 return (
PIX *)ERROR_PTR(
"pixad not made", __func__, NULL);
384 for (i = 0; i < n; i++) {
423 const char *sequence,
427 l_int32 n, i, w, h, same, maxd, fullpa, fullba;
429 PIX *pix1, *pix2, *pix3;
433 return (
PIXA *)ERROR_PTR(
"pixs not defined", __func__, NULL);
434 if (pixGetDepth(pixs) != 1)
435 return (
PIXA *)ERROR_PTR(
"pixs not 1 bpp", __func__, NULL);
437 return (
PIXA *)ERROR_PTR(
"sequence not defined", __func__, NULL);
439 return (
PIXA *)ERROR_PTR(
"pixam not defined", __func__, NULL);
442 return (
PIXA *)ERROR_PTR(
"mask depth not 1 bpp", __func__, NULL);
444 if (!fullpa || !fullba)
445 return (
PIXA *)ERROR_PTR(
"missing comps in pixam", __func__, NULL);
447 if (minw <= 0) minw = 1;
448 if (minh <= 0) minh = 1;
451 return (
PIXA *)ERROR_PTR(
"pixad not made", __func__, NULL);
456 for (i = 0; i < n; i++) {
458 if (w >= minw && h >= minh) {
469 L_ERROR(
"pix3 not made in iter %d; aborting\n", __func__, i);
502 if (!pixs || pixGetDepth(pixs) != 1)
503 return (
PIX *)ERROR_PTR(
"pixs undefined or not 1 bpp", __func__, NULL);
505 return (
PIX *)ERROR_PTR(
"sela not defined", __func__, NULL);
508 return (
PIX *)ERROR_PTR(
"no sels in sela", __func__, NULL);
509 if (type != L_MORPH_DILATE && type != L_MORPH_ERODE &&
510 type != L_MORPH_OPEN && type != L_MORPH_CLOSE &&
512 return (
PIX *)ERROR_PTR(
"invalid type", __func__, NULL);
515 for (i = 0; i < n; i++) {
517 if (type == L_MORPH_DILATE)
519 else if (type == L_MORPH_ERODE)
521 else if (type == L_MORPH_OPEN)
522 pixt =
pixOpen(NULL, pixs, sel);
523 else if (type == L_MORPH_CLOSE)
526 pixt =
pixHMT(NULL, pixs, sel);
527 pixOr(pixd, pixd, pixt);
553 if (!pixs || pixGetDepth(pixs) != 1)
554 return (
PIX *)ERROR_PTR(
"pixs undefined or not 1 bpp", __func__, NULL);
556 return (
PIX *)ERROR_PTR(
"sela not defined", __func__, NULL);
559 return (
PIX *)ERROR_PTR(
"no sels in sela", __func__, NULL);
560 if (type != L_MORPH_DILATE && type != L_MORPH_ERODE &&
561 type != L_MORPH_OPEN && type != L_MORPH_CLOSE &&
563 return (
PIX *)ERROR_PTR(
"invalid type", __func__, NULL);
567 for (i = 0; i < n; i++) {
569 if (type == L_MORPH_DILATE)
571 else if (type == L_MORPH_ERODE)
573 else if (type == L_MORPH_OPEN)
574 pixt =
pixOpen(NULL, pixs, sel);
575 else if (type == L_MORPH_CLOSE)
578 pixt =
pixHMT(NULL, pixs, sel);
602 l_int32 connectivity,
606 l_int32 n, i, x, y, w, h;
608 PIX *pix1, *pix2, *pixd;
612 return (
PIX *)ERROR_PTR(
"pixs not defined", __func__, NULL);
613 if (pixGetDepth(pixs) != 1)
614 return (
PIX *)ERROR_PTR(
"pixs not 1 bpp", __func__, NULL);
615 if (minw <= 0) minw = 1;
616 if (minh <= 0) minh = 1;
618 if ((boxa =
pixConnComp(pixs, &pixa, connectivity)) == NULL)
619 return (
PIX *)ERROR_PTR(
"boxa not made", __func__, NULL);
622 for (i = 0; i < n; i++) {
624 if (w >= minw && h >= minh) {
627 L_ERROR(
"pix2 not made in iter %d\n", __func__, i);
677 l_int32 i, nc, x, y, w, h, xb, yb;
685 return ERROR_INT(
"pixs not defined", __func__, 1);
687 return ERROR_INT(
"pixp not defined", __func__, 1);
689 return ERROR_INT(
"pixe not defined", __func__, 1);
690 if (pixGetDepth(pixs) != 1 || pixGetDepth(pixp) != 1 ||
691 pixGetDepth(pixe) != 1)
692 return ERROR_INT(
"all input pix not 1 bpp", __func__, 1);
693 if (dsize < 0 || dsize > 4)
694 return ERROR_INT(
"dsize not in {0,1,2,3,4}", __func__, 1);
699 L_WARNING(
"no matched patterns\n", __func__);
729 for (i = 0; i < nc; i++) {
732 pixRasterop(pixs, xb + x - x0 - dsize, yb + y - y0 - dsize,
782 l_int32 i, nc, xb, yb, x, y, xi, yi, rval, gval, bval;
784 PIX *pixd, *pixt, *pixps;
790 return (
PIX *)ERROR_PTR(
"pixs not defined", __func__, NULL);
792 return (
PIX *)ERROR_PTR(
"pixp not defined", __func__, NULL);
794 return (
PIX *)ERROR_PTR(
"pixe not defined", __func__, NULL);
795 if (pixGetDepth(pixs) != 1 || pixGetDepth(pixp) != 1 ||
796 pixGetDepth(pixe) != 1)
797 return (
PIX *)ERROR_PTR(
"all input pix not 1 bpp", __func__, NULL);
798 if (scale > 1.0 || scale <= 0.0) {
799 L_WARNING(
"scale > 1.0 or < 0.0; setting to 1.0\n", __func__);
806 L_WARNING(
"no matched patterns\n", __func__);
828 for (i = 0; i < nc; i++) {
839 for (i = 0; i < nc; i++) {
842 xi = (l_int32)(scale * (xb + x - x0));
843 yi = (l_int32)(scale * (yb + y - y0));
889 l_int32 maxdepth, i, j, n;
890 PIX *pix0, *pix1, *pix2;
895 return (
PIXA *)ERROR_PTR(
"pixas undefined", __func__, NULL);
897 L_INFO(
"niters = %d; nothing to do\n", __func__, niters);
900 if (type != L_MORPH_DILATE && type != L_MORPH_ERODE)
901 return (
PIXA *)ERROR_PTR(
"invalid type", __func__, NULL);
904 return (
PIXA *)ERROR_PTR(
"some pix have bpp > 1", __func__, NULL);
912 for (i = 0; i < n; i++) {
916 for (j = 0; j < niters; j++) {
917 if (type == L_MORPH_DILATE) {
958 l_int32 i, j, n, nsc, w, h, scalew, scaleh;
964 return (
PIXA *)ERROR_PTR(
"pixas undefined", __func__, NULL);
966 return (
PIXA *)ERROR_PTR(
"nasc undefined or empty", __func__, NULL);
967 if (type != L_HORIZ && type != L_VERT && type != L_BOTH_DIRECTIONS)
968 return (
PIXA *)ERROR_PTR(
"invalid type", __func__, NULL);
972 if ((pixad =
pixaCreate(n * (nsc + 1))) == NULL) {
973 L_ERROR(
"pixad not made: n = %d, nsc = %d\n", __func__, n, nsc);
976 for (i = 0; i < n; i++) {
980 for (j = 0; j < nsc; j++) {
984 if (type == L_HORIZ || type == L_BOTH_DIRECTIONS)
985 scalew = w * scalefact;
986 if (type == L_VERT || type == L_BOTH_DIRECTIONS)
987 scaleh = h * scalefact;
1022 l_int32 connectivity)
1025 PIX *pixt, *pixd, *temp;
1028 if (!pixs || pixGetDepth(pixs) != 1)
1029 return (
PIX *)ERROR_PTR(
"pixs undefined or not 1 bpp", __func__, NULL);
1031 return (
PIX *)ERROR_PTR(
"mask pix not defined", __func__, NULL);
1032 if (connectivity != 4 && connectivity != 8)
1033 return (
PIX *)ERROR_PTR(
"connectivity not in {4,8}", __func__, NULL);
1034 if (maxiters <= 0) maxiters = 1000;
1036 return (
PIX *)ERROR_PTR(
"pix sizes unequal", __func__, NULL);
1039 return (
PIX *)ERROR_PTR(
"sel_3 not made", __func__, NULL);
1040 if (connectivity == 4) {
1049 for (i = 1; i <= maxiters; i++) {
1051 pixAnd(pixd, pixd, pixm);
1053 if (same || i == maxiters)
1058 lept_stderr(
" Num iters in binary reconstruction = %d\n", i);
1084 l_int32 count, i, size;
1087 PIX *pix1, *pix2, *pix3;
1091 return (
NUMA *)ERROR_PTR(
"seed pix not defined", __func__, NULL);
1092 if (runtype != L_RUN_OFF && runtype != L_RUN_ON)
1093 return (
NUMA *)ERROR_PTR(
"invalid run type", __func__, NULL);
1094 if (direction != L_HORIZ && direction != L_VERT)
1095 return (
NUMA *)ERROR_PTR(
"direction not in {L_HORIZ, L_VERT}",
1097 if (pixGetDepth(pixs) != 1)
1098 return (
NUMA *)ERROR_PTR(
"pixs must be binary", __func__, NULL);
1100 if (direction == L_HORIZ)
1105 return (
NUMA *)ERROR_PTR(
"sel_2a not made", __func__, NULL);
1107 if (runtype == L_RUN_OFF) {
1108 if ((pix1 =
pixCopy(NULL, pixs)) == NULL) {
1110 return (
NUMA *)ERROR_PTR(
"pix1 not made", __func__, NULL);
1126 for (i = 0; i < maxsize / 2; i++) {
1139 for (i = 1; i < size - 1; i++) {
1185 return (
PIX *)ERROR_PTR(
"seed pix not defined", __func__, NULL);
1186 if (pixGetDepth(pixs) != 8)
1187 return (
PIX *)ERROR_PTR(
"pixs not 8 bpp", __func__, NULL);
1188 if (hsize < 1 || vsize < 1)
1189 return (
PIX *)ERROR_PTR(
"hsize or vsize < 1", __func__, NULL);
1190 if ((hsize & 1) == 0 ) {
1191 L_WARNING(
"horiz sel size must be odd; increasing by 1\n", __func__);
1194 if ((vsize & 1) == 0 ) {
1195 L_WARNING(
"vert sel size must be odd; increasing by 1\n", __func__);
1198 if (type != L_TOPHAT_WHITE && type != L_TOPHAT_BLACK)
1199 return (
PIX *)ERROR_PTR(
"type must be L_TOPHAT_BLACK or L_TOPHAT_WHITE",
1202 if (hsize == 1 && vsize == 1)
1207 case L_TOPHAT_WHITE:
1208 if ((pixt =
pixOpenGray(pixs, hsize, vsize)) == NULL)
1209 return (
PIX *)ERROR_PTR(
"pixt not made", __func__, NULL);
1213 case L_TOPHAT_BLACK:
1215 return (
PIX *)ERROR_PTR(
"pixd not made", __func__, NULL);
1219 return (
PIX *)ERROR_PTR(
"invalid type", __func__, NULL);
1277 l_int32 connectivity)
1282 return (
PIX *)ERROR_PTR(
"src pix not defined", __func__, NULL);
1283 if (pixGetDepth(pixs) != 8)
1284 return (
PIX *)ERROR_PTR(
"pixs not 8 bpp", __func__, NULL);
1286 return (
PIX *)ERROR_PTR(
"height not >= 0", __func__, NULL);
1290 if ((pixsd =
pixCopy(NULL, pixs)) == NULL)
1291 return (
PIX *)ERROR_PTR(
"pixsd not made", __func__, NULL);
1334 PIX *pix1, *pix2, *pix3, *pixd;
1337 return (
PIX *)ERROR_PTR(
"seed pix not defined", __func__, NULL);
1338 if (pixGetDepth(pixs) != 8)
1339 return (
PIX *)ERROR_PTR(
"pixs not 8 bpp", __func__, NULL);
1340 if (xsize < 1 || ysize < 1)
1341 return (
PIX *)ERROR_PTR(
"size < 1", __func__, NULL);
1342 if (type != L_TOPHAT_WHITE && type != L_TOPHAT_BLACK)
1343 return (
PIX *)ERROR_PTR(
"type must be L_TOPHAT_BLACK or L_TOPHAT_WHITE",
1346 if (xsize == 1 && ysize == 1)
1351 case L_TOPHAT_WHITE:
1354 return (
PIX *)ERROR_PTR(
"pix1 not made", __func__, NULL);
1360 case L_TOPHAT_BLACK:
1363 return (
PIX *)ERROR_PTR(
"pix1 not made", __func__, NULL);
1369 return (
PIX *)ERROR_PTR(
"invalid type", __func__, NULL);
1397 return (
PIX *)ERROR_PTR(
"seed pix not defined", __func__, NULL);
1398 if (pixGetDepth(pixs) != 8)
1399 return (
PIX *)ERROR_PTR(
"pixs not 8 bpp", __func__, NULL);
1400 if (hsize < 1 || vsize < 1)
1401 return (
PIX *)ERROR_PTR(
"hsize or vsize < 1", __func__, NULL);
1402 if ((hsize & 1) == 0 ) {
1403 L_WARNING(
"horiz sel size must be odd; increasing by 1\n", __func__);
1406 if ((vsize & 1) == 0 ) {
1407 L_WARNING(
"vert sel size must be odd; increasing by 1\n", __func__);
1444 l_int32 *centtab = NULL;
1445 l_int32 *sumtab = NULL;
1451 return (
PTA *)ERROR_PTR(
"pixa not defined", __func__, NULL);
1453 return (
PTA *)ERROR_PTR(
"no pix in pixa", __func__, NULL);
1456 return (
PTA *)ERROR_PTR(
"pta not defined", __func__, NULL);
1460 for (i = 0; i < n; i++) {
1462 if (
pixCentroid(pix, centtab, sumtab, &x, &y) == 1)
1463 L_ERROR(
"centroid failure for pix %d\n", __func__, i);
1500 l_int32 w, h, d, i, j, wpl, pixsum, rowsum, val;
1501 l_float32 xsum, ysum;
1502 l_uint32 *data, *line;
1505 l_int32 *ctab, *stab;
1507 if (!pxave || !pyave)
1508 return ERROR_INT(
"&pxave and &pyave not defined", __func__, 1);
1509 *pxave = *pyave = 0.0;
1511 return ERROR_INT(
"pix not defined", __func__, 1);
1513 if (d != 1 && d != 8)
1514 return ERROR_INT(
"pix not 1 or 8 bpp", __func__, 1);
1527 wpl = pixGetWpl(pix);
1531 for (i = 0; i < h; i++) {
1546 line = data + wpl * i;
1548 for (j = 0; j < wpl; j++) {
1552 rowsum += stab[byte];
1553 xsum += ctab[byte] + (j * 32 + 24) * stab[
byte];
1554 byte = (word >> 8) & 0xff;
1555 rowsum += stab[byte];
1556 xsum += ctab[byte] + (j * 32 + 16) * stab[
byte];
1557 byte = (word >> 16) & 0xff;
1558 rowsum += stab[byte];
1559 xsum += ctab[byte] + (j * 32 + 8) * stab[
byte];
1560 byte = (word >> 24) & 0xff;
1561 rowsum += stab[byte];
1562 xsum += ctab[byte] + j * 32 * stab[byte];
1569 L_WARNING(
"no ON pixels in pix\n", __func__);
1571 *pxave = xsum / (l_float32)pixsum;
1572 *pyave = ysum / (l_float32)pixsum;
1575 for (i = 0; i < h; i++) {
1576 line = data + wpl * i;
1577 for (j = 0; j < w; j++) {
1585 L_WARNING(
"all pixels are 0\n", __func__);
1587 *pxave = xsum / (l_float32)pixsum;
1588 *pyave = ysum / (l_float32)pixsum;
1593 if (!centtab) LEPT_FREE(ctab);
1594 if (!sumtab) LEPT_FREE(stab);
#define GET_DATA_BYTE(pdata, n)
void boxDestroy(BOX **pbox)
boxDestroy()
l_ok boxaGetBoxGeometry(BOXA *boxa, l_int32 index, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxaGetBoxGeometry()
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
l_int32 boxaGetCount(const BOXA *boxa)
boxaGetCount()
PIXCMAP * pixcmapCreate(l_int32 depth)
pixcmapCreate()
l_ok pixcmapAddColor(PIXCMAP *cmap, l_int32 rval, l_int32 gval, l_int32 bval)
pixcmapAddColor()
l_ok pixEqual(PIX *pix1, PIX *pix2, l_int32 *psame)
pixEqual()
BOXA * pixConnComp(PIX *pixs, PIXA **ppixa, l_int32 connectivity)
pixConnComp()
PIX * pixBlockconv(PIX *pix, l_int32 wc, l_int32 hc)
pixBlockconv()
PIX * pixBlockconvGray(PIX *pixs, PIX *pixacc, l_int32 wc, l_int32 hc)
pixBlockconvGray()
PIX * pixCloseGray(PIX *pixs, l_int32 hsize, l_int32 vsize)
pixCloseGray()
PIX * pixDilateGray(PIX *pixs, l_int32 hsize, l_int32 vsize)
pixDilateGray()
PIX * pixOpenGray(PIX *pixs, l_int32 hsize, l_int32 vsize)
pixOpenGray()
PIX * pixThresholdTo4bpp(PIX *pixs, l_int32 nlevels, l_int32 cmapflag)
pixThresholdTo4bpp()
PIX * pixOpen(PIX *pixd, PIX *pixs, SEL *sel)
pixOpen()
PIX * pixErode(PIX *pixd, PIX *pixs, SEL *sel)
pixErode()
PIX * pixClose(PIX *pixd, PIX *pixs, SEL *sel)
pixClose()
PIX * pixErodeBrick(PIX *pixd, PIX *pixs, l_int32 hsize, l_int32 vsize)
pixErodeBrick()
PIX * pixDilate(PIX *pixd, PIX *pixs, SEL *sel)
pixDilate()
PIX * pixHMT(PIX *pixd, PIX *pixs, SEL *sel)
pixHMT()
PIX * pixDilateBrick(PIX *pixd, PIX *pixs, l_int32 hsize, l_int32 vsize)
pixDilateBrick()
PIX * pixMorphGradient(PIX *pixs, l_int32 hsize, l_int32 vsize, l_int32 smoothing)
pixMorphGradient()
PIX * pixSeedfillMorph(PIX *pixs, PIX *pixm, l_int32 maxiters, l_int32 connectivity)
pixSeedfillMorph()
PTA * pixaCentroids(PIXA *pixa)
pixaCentroids()
l_ok pixRemoveMatchedPattern(PIX *pixs, PIX *pixp, PIX *pixe, l_int32 x0, l_int32 y0, l_int32 dsize)
pixRemoveMatchedPattern()
PIX * pixDisplayMatchedPattern(PIX *pixs, PIX *pixp, PIX *pixe, l_int32 x0, l_int32 y0, l_uint32 color, l_float32 scale, l_int32 nlevels)
pixDisplayMatchedPattern()
PIX * pixMorphSequenceMasked(PIX *pixs, PIX *pixm, const char *sequence, l_int32 dispsep)
pixMorphSequenceMasked()
PIX * pixSelectiveConnCompFill(PIX *pixs, l_int32 connectivity, l_int32 minw, l_int32 minh)
pixSelectiveConnCompFill()
PIX * pixHDome(PIX *pixs, l_int32 height, l_int32 connectivity)
pixHDome()
PIXA * pixaExtendByScaling(PIXA *pixas, NUMA *nasc, l_int32 type, l_int32 include)
pixaExtendByScaling()
PIX * pixMorphSequenceByRegion(PIX *pixs, PIX *pixm, const char *sequence, l_int32 connectivity, l_int32 minw, l_int32 minh, BOXA **pboxa)
pixMorphSequenceByRegion()
PIX * pixTophat(PIX *pixs, l_int32 hsize, l_int32 vsize, l_int32 type)
pixTophat()
PIX * pixIntersectionOfMorphOps(PIX *pixs, SELA *sela, l_int32 type)
pixIntersectionOfMorphOps()
l_ok pixCentroid(PIX *pix, l_int32 *centtab, l_int32 *sumtab, l_float32 *pxave, l_float32 *pyave)
pixCentroid()
PIX * pixUnionOfMorphOps(PIX *pixs, SELA *sela, l_int32 type)
pixUnionOfMorphOps()
PIXA * pixaMorphSequenceByComponent(PIXA *pixas, const char *sequence, l_int32 minw, l_int32 minh)
pixaMorphSequenceByComponent()
PIX * pixMorphSequenceByComponent(PIX *pixs, const char *sequence, l_int32 connectivity, l_int32 minw, l_int32 minh, BOXA **pboxa)
pixMorphSequenceByComponent()
PIXA * pixaExtendByMorph(PIXA *pixas, l_int32 type, l_int32 niters, SEL *sel, l_int32 include)
pixaExtendByMorph()
PIX * pixFastTophat(PIX *pixs, l_int32 xsize, l_int32 ysize, l_int32 type)
pixFastTophat()
PIXA * pixaMorphSequenceByRegion(PIX *pixs, PIXA *pixam, const char *sequence, l_int32 minw, l_int32 minh)
pixaMorphSequenceByRegion()
NUMA * pixRunHistogramMorph(PIX *pixs, l_int32 runtype, l_int32 direction, l_int32 maxsize)
pixRunHistogramMorph()
PIX * pixExtractBoundary(PIX *pixs, l_int32 type)
pixExtractBoundary()
PIX * pixMorphSequence(PIX *pixs, const char *sequence, l_int32 dispsep)
pixMorphSequence()
PIX * pixMorphCompSequence(PIX *pixs, const char *sequence, l_int32 dispsep)
pixMorphCompSequence()
l_ok numaAddNumber(NUMA *na, l_float32 val)
numaAddNumber()
l_ok numaGetFValue(NUMA *na, l_int32 index, l_float32 *pval)
numaGetFValue()
NUMA * numaCreate(l_int32 n)
numaCreate()
void numaDestroy(NUMA **pna)
numaDestroy()
l_int32 numaGetCount(NUMA *na)
numaGetCount()
l_ok pixSetMaskedCmap(PIX *pixs, PIX *pixm, l_int32 x, l_int32 y, l_int32 rval, l_int32 gval, l_int32 bval)
pixSetMaskedCmap()
l_uint32 * pixGetData(PIX *pix)
pixGetData()
l_ok pixSetColormap(PIX *pix, PIXCMAP *colormap)
pixSetColormap()
void pixDestroy(PIX **ppix)
pixDestroy()
l_ok pixGetDimensions(const PIX *pix, l_int32 *pw, l_int32 *ph, l_int32 *pd)
pixGetDimensions()
l_int32 pixSizesEqual(const PIX *pix1, const PIX *pix2)
pixSizesEqual()
PIX * pixCopy(PIX *pixd, const PIX *pixs)
pixCopy()
PIX * pixCreateTemplate(const PIX *pixs)
pixCreateTemplate()
PIX * pixClone(PIX *pixs)
pixClone()
PIX * pixAddBorder(PIX *pixs, l_int32 npix, l_uint32 val)
pixAddBorder()
l_ok pixSetAll(PIX *pix)
pixSetAll()
l_ok pixSetPadBits(PIX *pix, l_int32 val)
pixSetPadBits()
void extractRGBValues(l_uint32 pixel, l_int32 *prval, l_int32 *pgval, l_int32 *pbval)
extractRGBValues()
PIX * pixInvert(PIX *pixd, PIX *pixs)
pixInvert()
l_ok pixCountPixels(PIX *pixs, l_int32 *pcount, l_int32 *tab8)
pixCountPixels()
PIX * pixOr(PIX *pixd, PIX *pixs1, PIX *pixs2)
pixOr()
PIX * pixAnd(PIX *pixd, PIX *pixs1, PIX *pixs2)
pixAnd()
l_int32 * makePixelSumTab8(void)
makePixelSumTab8()
PIX * pixXor(PIX *pixd, PIX *pixs1, PIX *pixs2)
pixXor()
l_int32 * makePixelCentroidTab8(void)
makePixelCentroidTab8()
l_ok pixCombineMasked(PIX *pixd, PIX *pixs, PIX *pixm)
pixCombineMasked()
PIX * pixClipRectangle(PIX *pixs, BOX *box, BOX **pboxc)
pixClipRectangle()
l_ok pixaAddPix(PIXA *pixa, PIX *pix, l_int32 copyflag)
pixaAddPix()
void pixaDestroy(PIXA **ppixa)
pixaDestroy()
l_ok pixaVerifyDepth(PIXA *pixa, l_int32 *psame, l_int32 *pmaxd)
pixaVerifyDepth()
BOX * pixaGetBox(PIXA *pixa, l_int32 index, l_int32 accesstype)
pixaGetBox()
l_int32 pixaGetBoxaCount(PIXA *pixa)
pixaGetBoxaCount()
PIXA * pixaCreate(l_int32 n)
pixaCreate()
l_ok pixaGetPixDimensions(PIXA *pixa, l_int32 index, l_int32 *pw, l_int32 *ph, l_int32 *pd)
pixaGetPixDimensions()
PIXA * pixaCopy(PIXA *pixa, l_int32 copyflag)
pixaCopy()
l_int32 pixaGetCount(PIXA *pixa)
pixaGetCount()
l_ok pixaAddBox(PIXA *pixa, BOX *box, l_int32 copyflag)
pixaAddBox()
l_ok pixaIsFull(PIXA *pixa, l_int32 *pfullpa, l_int32 *pfullba)
pixaIsFull()
BOXA * pixaGetBoxa(PIXA *pixa, l_int32 accesstype)
pixaGetBoxa()
l_ok pixaGetBoxGeometry(PIXA *pixa, l_int32 index, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
pixaGetBoxGeometry()
PIX * pixaGetPix(PIXA *pixa, l_int32 index, l_int32 accesstype)
pixaGetPix()
l_ok pixaGetDepthInfo(PIXA *pixa, l_int32 *pmaxdepth, l_int32 *psame)
pixaGetDepthInfo()
l_ok pixAddConstantGray(PIX *pixs, l_int32 val)
pixAddConstantGray()
PIX * pixSubtractGray(PIX *pixd, PIX *pixs1, PIX *pixs2)
pixSubtractGray()
PIX * pixConvert1To4(PIX *pixd, PIX *pixs, l_int32 val0, l_int32 val1)
pixConvert1To4()
l_ok ptaGetIPt(PTA *pta, l_int32 index, l_int32 *px, l_int32 *py)
ptaGetIPt()
l_ok ptaAddPt(PTA *pta, l_float32 x, l_float32 y)
ptaAddPt()
PTA * ptaCreate(l_int32 n)
ptaCreate()
void ptaDestroy(PTA **ppta)
ptaDestroy()
l_ok pixRasterop(PIX *pixd, l_int32 dx, l_int32 dy, l_int32 dw, l_int32 dh, l_int32 op, PIX *pixs, l_int32 sx, l_int32 sy)
pixRasterop()
PIX * pixScaleToSize(PIX *pixs, l_int32 wd, l_int32 hd)
pixScaleToSize()
PIX * pixScaleBySampling(PIX *pixs, l_float32 scalex, l_float32 scaley)
pixScaleBySampling()
PIX * pixScaleGrayMinMax(PIX *pixs, l_int32 xfact, l_int32 yfact, l_int32 type)
pixScaleGrayMinMax()
PIX * pixScaleToGray(PIX *pixs, l_float32 scalefactor)
pixScaleToGray()
PIX * pixHolesByFilling(PIX *pixs, l_int32 connectivity)
pixHolesByFilling()
l_ok pixSeedfillGray(PIX *pixs, PIX *pixm, l_int32 connectivity)
pixSeedfillGray()
SEL * selCopy(SEL *sel)
selCopy()
void selDestroy(SEL **psel)
selDestroy()
l_ok selSetElement(SEL *sel, l_int32 row, l_int32 col, l_int32 type)
selSetElement()
SEL * selaGetSel(SELA *sela, l_int32 i)
selaGetSel()
l_int32 selaGetCount(SELA *sela)
selaGetCount()
SEL * selCreateBrick(l_int32 h, l_int32 w, l_int32 cy, l_int32 cx, l_int32 type)
selCreateBrick()
void lept_stderr(const char *fmt,...)
lept_stderr()