84 #include <config_auto.h> 88 #include "allheaders.h" 89 #include "readbarcode.h" 92 static const l_int32 MAX_SPACE_WIDTH = 19;
93 static const l_int32 MAX_NOISE_WIDTH = 50;
94 static const l_int32 MAX_NOISE_HEIGHT = 30;
97 static const l_int32 MIN_BC_WIDTH = 50;
98 static const l_int32 MIN_BC_HEIGHT = 50;
102 l_int32 nwidth, l_int32 nheight);
105 NUMA **pnaodist, l_float32 *pmindist,
106 l_float32 *pmaxdist);
108 l_float32 minsep, l_float32 maxmin);
112 l_int32 nshift, l_float32 minwidth,
114 l_float32 *pbestwidth,
115 l_float32 *pbestshift,
116 l_float32 *pbestscore);
118 l_float32 width, l_float32 shift,
119 l_float32 *pscore,
NUMA **pnad);
122 #ifndef NO_CONSOLE_IO 123 #define DEBUG_DESKEW 0 124 #define DEBUG_WIDTHS 0 152 PROCNAME(
"pixProcessBarcodes");
154 if (psaw) *psaw = NULL;
156 return (
SARRAY *)ERROR_PTR(
"pixs not defined", procName, NULL);
158 return (
SARRAY *)ERROR_PTR(
"unsupported format", procName, NULL);
159 if (method != L_USE_WIDTHS && method != L_USE_WINDOWS)
160 return (
SARRAY *)ERROR_PTR(
"invalid method", procName, NULL);
163 if (pixGetDepth(pixs) == 8 && !pixGetColormap(pixs))
171 return (
SARRAY *)ERROR_PTR(
"no barcode(s) found", procName, NULL);
192 l_float32 angle, conf;
195 PIX *pix1, *pix2, *pix3;
198 PROCNAME(
"pixExtractBarcodes");
200 if (!pixs || pixGetDepth(pixs) != 8 || pixGetColormap(pixs))
201 return (
PIXA *)ERROR_PTR(
"pixs undefined or not 8 bpp", procName, NULL);
206 L_INFO(
"%d possible barcode(s) found\n", procName, n);
216 pixDisplay(pix2, 100, 100);
217 pixDisplay(pix1, 800, 100);
223 for (i = 0; i < n; i++) {
226 if (!pix3) conf = 0.0;
227 L_INFO(
"angle = %6.2f, conf = %6.2f\n", procName, angle, conf);
241 pixWrite(
"/tmp/lept/pix3.png", pix3, IFF_PNG);
268 char emptystring[] =
"";
269 l_int32 w, h, i, j, n, nbars, ival;
274 PROCNAME(
"pixReadBarcodes");
276 if (psaw) *psaw = NULL;
278 return (
SARRAY *)ERROR_PTR(
"pixa not defined", procName, NULL);
280 return (
SARRAY *)ERROR_PTR(
"unsupported format", procName, NULL);
281 if (method != L_USE_WIDTHS && method != L_USE_WINDOWS)
282 return (
SARRAY *)ERROR_PTR(
"invalid method", procName, NULL);
287 for (i = 0; i < n; i++) {
291 if (w < MIN_BC_WIDTH || h < MIN_BC_HEIGHT) {
292 L_ERROR(
"pix is too small: w = %d, h = %d\n", procName, w, h);
299 ERROR_INT(
"valid barcode widths not returned", procName, 1);
305 barstr = (
char *)LEPT_CALLOC(nbars + 1,
sizeof(
char));
306 for (j = 0; j < nbars; j++) {
308 barstr[j] = 0x30 + ival;
316 ERROR_INT(
"barcode not decoded", procName, 1);
327 return (
SARRAY *)ERROR_PTR(
"no valid barcode data", procName, NULL);
354 PROCNAME(
"pixReadBarcodeWidths");
357 return (
NUMA *)ERROR_PTR(
"pixs not defined", procName, NULL);
358 if (pixGetDepth(pixs) != 8)
359 return (
NUMA *)ERROR_PTR(
"pixs not 8 bpp", procName, NULL);
360 if (method != L_USE_WIDTHS && method != L_USE_WINDOWS)
361 return (
NUMA *)ERROR_PTR(
"invalid method", procName, NULL);
364 if (method == L_USE_WIDTHS)
371 if (method == L_USE_WINDOWS)
372 lept_stderr(
"Window width for barcode: %7.3f\n", winwidth);
377 return (
NUMA *)ERROR_PTR(
"barcode widths invalid", procName, NULL);
402 PIX *pix8, *pixe, *pixb, *pixm;
404 PROCNAME(
"pixLocateBarcodes");
407 return (
BOXA *)ERROR_PTR(
"pixs not defined", procName, NULL);
410 if (pixGetDepth(pixs) == 8 && !pixGetColormap(pixs))
461 PIX *pixt1, *pixt2, *pixd;
463 PROCNAME(
"pixGenerateBarcodeMask");
465 if (!pixs || pixGetDepth(pixs) != 1)
466 return (
PIX *)ERROR_PTR(
"pixs not defined", procName, NULL);
471 pixXor(pixt2, pixt2, pixt1);
478 pixXor(pixd, pixd, pixt1);
483 pixOr(pixd, pixd, pixt2);
520 l_int32 x, y, w, h, n;
521 l_float32 angle, angle1, angle2, conf, conf1, conf2, score1, score2, deg2rad;
524 PIX *pix1, *pix2, *pix3, *pix4, *pix5, *pix6, *pixd;
526 PROCNAME(
"pixDeskewBarcode");
528 if (pangle) *pangle = 0.0;
529 if (pconf) *pconf = 0.0;
530 if (!pixs || pixGetDepth(pixs) != 8)
531 return (
PIX *)ERROR_PTR(
"pixs undefined or not 8 bpp", procName, NULL);
532 if (!pixb || pixGetDepth(pixb) != 1)
533 return (
PIX *)ERROR_PTR(
"pixb undefined or not 1 bpp", procName, NULL);
535 return (
PIX *)ERROR_PTR(
"box not defined or 1 bpp", procName, NULL);
538 deg2rad = 3.1415926535 / 180.;
540 box2 =
boxCreate(x - 25, y - 25, w + 51, h + 51);
549 1, 1, 0.0, 45.0, 2.5, 0.01);
551 1, 1, 0.0, 45.0, 2.5, 0.01);
562 if (score1 >= score2) {
564 if (conf1 > 6.0 && L_ABS(angle1) > 0.1) {
575 if (conf2 > 6.0 && L_ABS(angle2) > 0.1) {
576 angle = 90.0 + angle2;
590 L_WARNING(
"barcode mask in %d components\n", procName, n);
597 box2 =
boxCreate(x - margin, y - margin, w + 2 * margin,
606 if (pangle) *pangle = angle;
607 if (pconf) *pconf = conf;
610 L_ERROR(
"pixd not made\n", procName);
651 PROCNAME(
"pixExtractBarcodeWidths1");
653 if (pnaehist) *pnaehist = NULL;
654 if (pnaohist) *pnaehist = NULL;
655 if (!pixs || pixGetDepth(pixs) != 8)
656 return (
NUMA *)ERROR_PTR(
"pixs undefined or not 8 bpp", procName, NULL);
660 return (
NUMA *)ERROR_PTR(
"nac not made", procName, NULL);
664 pnaohist, debugflag);
705 NUMA *nac, *nacp, *nad;
707 PROCNAME(
"pixExtractBarcodeWidths2");
709 if (pwidth) *pwidth = 0;
710 if (pnac) *pnac = NULL;
711 if (!pixs || pixGetDepth(pixs) != 8)
712 return (
NUMA *)ERROR_PTR(
"pixs undefined or not 8 bpp", procName, NULL);
716 return (
NUMA *)ERROR_PTR(
"nacp not made", procName, NULL);
746 l_float32 bestthresh;
748 NUMA *nas, *nax, *nay, *nad;
750 PROCNAME(
"pixExtractBarcodeCrossings");
752 if (!pixs || pixGetDepth(pixs) != 8)
753 return (
NUMA *)ERROR_PTR(
"pixs undefined or not 8 bpp", procName, NULL);
757 return (
NUMA *)ERROR_PTR(
"nas not made", procName, NULL);
760 w = pixGetWidth(pixs);
762 (l_float32)(w - 1), 4 * w + 1, &nax, &nay);
766 gplot =
gplotCreate(
"/tmp/lept/barcode/signal", GPLOT_PNG,
767 "Pixel values",
"dist in pixels",
"value");
785 L_ERROR(
"Only %d crossings; failure\n", procName,
numaGetCount(nad));
806 l_int32 w, h, first, last, i, j, wpl, val;
807 l_uint32 *line, *data;
811 PROCNAME(
"pixAverageRasterScans");
813 if (!pixs || pixGetDepth(pixs) != 8)
814 return (
NUMA *)ERROR_PTR(
"pixs undefined or not 8 bpp", procName, NULL);
822 first = (h - nscans) / 2;
823 last = first + nscans - 1;
829 wpl = pixGetWpl(pixs);
831 for (j = 0; j < w; j++) {
832 for (i = first; i <= last; i++) {
833 line = data + i * wpl;
837 array[j] = array[j] / (l_float32)nscans;
877 l_int32 i, n, ret, ned, nod, iw, width;
878 l_float32 val, minsize, maxsize, factor;
880 NUMA *naedist, *naodist, *naehist, *naohist, *naecent, *naocent;
881 NUMA *naerange, *naorange, *naelut, *naolut, *nad;
883 PROCNAME(
"numaQuantizeCrossingsByWidth");
885 if (pnaehist) *pnaehist = NULL;
886 if (pnaohist) *pnaohist = NULL;
888 return (
NUMA *)ERROR_PTR(
"nas not defined", procName, NULL);
891 return (
NUMA *)ERROR_PTR(
"n < 10", procName, NULL);
893 return (
NUMA *)ERROR_PTR(
"binfract <= 0.0", procName, NULL);
898 if (ret || minsize < 1.0 || maxsize / minsize > 8.0) {
899 L_ERROR(
"bad data, or minsize = %5.2f < 1.0 or max/min = %f > 4.0\n",
900 procName, minsize, maxsize / minsize);
913 (1.25 / binfract) * maxsize);
915 (1.25 / binfract) * maxsize);
919 gplot =
gplotCreate(
"/tmp/lept/barcode/histw", GPLOT_PNG,
920 "Raw width histogram",
"Width",
"Number");
921 gplotAddPlot(gplot, NULL, naehist, GPLOT_LINES,
"plot black");
922 gplotAddPlot(gplot, NULL, naohist, GPLOT_LINES,
"plot white");
929 1.0 / binfract, 0.0);
931 1.0 / binfract, 0.0);
951 L_WARNING(
"ned != nod + 1\n", procName);
952 factor = 1.0 / (binfract * minsize);
953 for (i = 0; i < ned - 1; i++) {
955 width = (l_int32)(factor * val);
961 width = (l_int32)(factor * val);
968 width = (l_int32)(factor * val);
973 lept_stderr(
" ---- Black bar widths (pixels) ------ \n");
975 lept_stderr(
" ---- Histogram of black bar widths ------ \n");
977 lept_stderr(
" ---- Peak ranges in black bar histogram bins --- \n");
979 lept_stderr(
" ---- Peak black bar centroid width values ------ \n");
981 lept_stderr(
" ---- Black bar lookup table ------ \n");
983 lept_stderr(
" ---- White bar widths (pixels) ------ \n");
985 lept_stderr(
" ---- Histogram of white bar widths ------ \n");
987 lept_stderr(
" ---- Peak ranges in white bar histogram bins --- \n");
989 lept_stderr(
" ---- Peak white bar centroid width values ------ \n");
991 lept_stderr(
" ---- White bar lookup table ------ \n");
1004 *pnaehist = naehist;
1008 *pnaohist = naohist;
1029 l_float32 *pmindist,
1030 l_float32 *pmaxdist)
1032 l_int32 i, n, nspan;
1033 l_float32 val, newval, mindist, maxdist, dist;
1034 NUMA *na1, *na2, *naedist, *naodist;
1036 PROCNAME(
"numaGetCrossingDistances");
1038 if (pnaedist) *pnaedist = NULL;
1039 if (pnaodist) *pnaodist = NULL;
1040 if (pmindist) *pmindist = 0.0;
1041 if (pmaxdist) *pmaxdist = 0.0;
1043 return ERROR_INT(
"nas not defined", procName, 1);
1045 return ERROR_INT(
"n < 2", procName, 1);
1054 for (i = 1; i < n; i++) {
1072 L_INFO(
"mindist = %7.3f, maxdist = %7.3f\n", procName, mindist, maxdist);
1075 *pnaedist = naedist;
1079 *pnaodist = naodist;
1082 if (pmindist) *pmindist = mindist;
1083 if (pmaxdist) *pmaxdist = maxdist;
1122 l_int32 i, n, inpeak, left;
1123 l_float32 center, prevcenter, val;
1126 PROCNAME(
"numaLocatePeakRanges");
1129 return (
NUMA *)ERROR_PTR(
"nas not defined", procName, NULL);
1134 prevcenter = minfirst - minsep - 1.0;
1135 for (i = 0; i < n; i++) {
1137 if (inpeak == FALSE && val > maxmin) {
1140 }
else if (inpeak == TRUE && val <= maxmin) {
1141 center = (left + i - 1.0) / 2.0;
1142 if (center - prevcenter >= minsep) {
1146 prevcenter = center;
1152 if (inpeak == TRUE) {
1173 l_int32 i, j, nr, low, high;
1174 l_float32 cent, sum, val;
1177 PROCNAME(
"numaGetPeakCentroids");
1180 return (
NUMA *)ERROR_PTR(
"nahist not defined", procName, NULL);
1182 return (
NUMA *)ERROR_PTR(
"narange not defined", procName, NULL);
1186 for (i = 0; i < nr; i++) {
1191 for (j = low; j <= high; j++) {
1224 l_int32 i, j, nc, low, high, imax;
1227 l_float32 max, rat21, rat32, rat42;
1230 PROCNAME(
"numaGetPeakWidthLUT");
1233 return (
NUMA *)ERROR_PTR(
"narange not defined", procName, NULL);
1235 return (
NUMA *)ERROR_PTR(
"nacent not defined", procName, NULL);
1237 if (nc < 1 || nc > 4)
1238 return (
NUMA *)ERROR_PTR(
"nc must be 1, 2, 3, or 4", procName, NULL);
1247 return (
NUMA *)ERROR_PTR(
"first peak has width 0.0",
1249 rat21 = warray[1] / warray[0];
1250 if (rat21 < 1.5 || rat21 > 2.6)
1251 L_WARNING(
"width ratio 2/1 = %f\n", procName, rat21);
1253 rat32 = warray[2] / warray[1];
1254 if (rat32 < 1.3 || rat32 > 2.25)
1255 L_WARNING(
"width ratio 3/2 = %f\n", procName, rat32);
1258 rat42 = warray[3] / warray[1];
1259 if (rat42 < 1.7 || rat42 > 2.3)
1260 L_WARNING(
"width ratio 4/2 = %f\n", procName, rat42);
1266 for (i = 0; i < 4; i++)
1275 imax = (l_int32)max;
1278 for (i = 0; i < nc; i++) {
1282 for (j = low; j <= high; j++)
1316 l_float32 *pfirstloc,
1320 l_int32 i, nw, started, count, trans;
1321 l_float32 minsize, minwidth, minshift, xfirst;
1324 PROCNAME(
"numaQuantizeCrossingsByWindow");
1327 return (
NUMA *)ERROR_PTR(
"nas not defined", procName, NULL);
1329 return (
NUMA *)ERROR_PTR(
"nas size < 2", procName, NULL);
1338 &minwidth, &minshift, NULL);
1342 &minwidth, &minshift, NULL);
1344 L_INFO(
"best width = %7.3f, best shift = %7.3f\n",
1345 procName, minwidth, minshift);
1349 if (pwidth) *pwidth = minwidth;
1352 *pfirstloc = xfirst + minshift;
1360 for (i = 0; i < nw; i++) {
1363 L_WARNING(
"trans = %d > 2 !!!\n", procName, trans);
1377 if (!started && trans) {
1420 l_float32 *pbestwidth,
1421 l_float32 *pbestshift,
1422 l_float32 *pbestscore)
1425 l_float32 delwidth, delshift, width, shift, score;
1426 l_float32 bestwidth, bestshift, bestscore;
1428 PROCNAME(
"numaEvalBestWidthAndShift");
1431 return ERROR_INT(
"nas not defined", procName, 1);
1432 if (!pbestwidth || !pbestshift)
1433 return ERROR_INT(
"&bestwidth and &bestshift not defined", procName, 1);
1438 delwidth = (maxwidth - minwidth) / (nwidth - 1.0);
1439 for (i = 0; i < nwidth; i++) {
1440 width = minwidth + delwidth * i;
1441 delshift = width / (l_float32)(nshift);
1442 for (j = 0; j < nshift; j++) {
1443 shift = -0.5 * (width - delshift) + j * delshift;
1445 if (score < bestscore) {
1450 lept_stderr(
"width = %7.3f, shift = %7.3f, score = %7.3f\n",
1451 width, shift, score);
1457 *pbestwidth = bestwidth;
1458 *pbestshift = bestshift;
1460 *pbestscore = bestscore;
1497 l_int32 i, n, nc, nw, ival;
1499 l_float32 score, xfirst, xlast, xleft, xc, xwc;
1502 PROCNAME(
"numaEvalSyncError");
1505 return ERROR_INT(
"nas not defined", procName, 1);
1507 return ERROR_INT(
"nas size < 2", procName, 1);
1508 if (ifirst < 0) ifirst = 0;
1509 if (ilast <= 0) ilast = n - 1;
1510 if (ifirst >= ilast)
1511 return ERROR_INT(
"ifirst not < ilast", procName, 1);
1512 nc = ilast - ifirst + 1;
1519 nw = (l_int32) ((xlast - xfirst + 2.0 * width) / width);
1522 xleft = xfirst - width / 2.0 + shift;
1523 for (i = ifirst; i <= ilast; i++) {
1525 iw = (l_int32)((xc - xleft) / width);
1526 xwc = xleft + (iw + 0.5) * width;
1527 score += (xwc - xc) * (xwc - xc);
1533 *pscore = 4.0 * score / (width * width * (l_float32)nc);
void gplotDestroy(GPLOT **pgplot)
gplotDestroy()
NUMA * pixExtractBarcodeCrossings(PIX *pixs, l_float32 thresh, l_int32 debugflag)
pixExtractBarcodeCrossings()
l_ok numaGetFValue(NUMA *na, l_int32 index, l_float32 *pval)
numaGetFValue()
l_int32 lept_mkdir(const char *subdir)
lept_mkdir()
BOXA * boxaSort(BOXA *boxas, l_int32 sorttype, l_int32 sortorder, NUMA **pnaindex)
boxaSort()
static PIX * pixGenerateBarcodeMask(PIX *pixs, l_int32 maxspace, l_int32 nwidth, l_int32 nheight)
pixGenerateBarcodeMask()
NUMA * numaMakeHistogram(NUMA *na, l_int32 maxbins, l_int32 *pbinsize, l_int32 *pbinstart)
numaMakeHistogram()
PIX * pixCloseBrick(PIX *pixd, PIX *pixs, l_int32 hsize, l_int32 vsize)
pixCloseBrick()
l_ok numaAddNumber(NUMA *na, l_float32 val)
numaAddNumber()
PIXA * pixaCreate(l_int32 n)
pixaCreate()
l_ok gplotMakeOutput(GPLOT *gplot)
gplotMakeOutput()
GPLOT * gplotCreate(const char *rootname, l_int32 outformat, const char *title, const char *xlabel, const char *ylabel)
gplotCreate()
static l_int32 numaEvalSyncError(NUMA *nas, l_int32 ifirst, l_int32 ilast, l_float32 width, l_float32 shift, l_float32 *pscore, NUMA **pnad)
numaEvalSyncError()
static l_int32 numaEvalBestWidthAndShift(NUMA *nas, l_int32 nwidth, l_int32 nshift, l_float32 minwidth, l_float32 maxwidth, l_float32 *pbestwidth, l_float32 *pbestshift, l_float32 *pbestscore)
numaEvalBestWidthAndShift()
PIX * pixConvertTo8(PIX *pixs, l_int32 cmapflag)
pixConvertTo8()
void lept_stderr(const char *fmt,...)
lept_stderr()
NUMA * numaQuantizeCrossingsByWidth(NUMA *nas, l_float32 binfract, NUMA **pnaehist, NUMA **pnaohist, l_int32 debugflag)
numaQuantizeCrossingsByWidth()
NUMA * numaMakeHistogramClipped(NUMA *na, l_float32 binsize, l_float32 maxsize)
numaMakeHistogramClipped()
char * barcodeDispatchDecoder(char *barstr, l_int32 format, l_int32 debugflag)
barcodeDispatchDecoder()
l_ok pixFindSkewSweepAndSearchScore(PIX *pixs, l_float32 *pangle, l_float32 *pconf, l_float32 *pendscore, l_int32 redsweep, l_int32 redsearch, l_float32 sweepcenter, l_float32 sweeprange, l_float32 sweepdelta, l_float32 minbsdelta)
pixFindSkewSweepAndSearchScore()
SARRAY * sarrayCreate(l_int32 n)
sarrayCreate()
PIX * pixInvert(PIX *pixd, PIX *pixs)
pixInvert()
NUMA * numaQuantizeCrossingsByWindow(NUMA *nas, l_float32 ratio, l_float32 *pwidth, l_float32 *pfirstloc, NUMA **pnac, l_int32 debugflag)
numaQuantizeCrossingsByWindow()
BOXA * boxaCopy(BOXA *boxa, l_int32 copyflag)
boxaCopy()
NUMA * numaCreate(l_int32 n)
numaCreate()
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
l_uint32 * pixGetData(PIX *pix)
pixGetData()
l_ok numaSetCount(NUMA *na, l_int32 newcount)
numaSetCount()
PIX * pixThresholdToBinary(PIX *pixs, l_int32 thresh)
pixThresholdToBinary()
PIX * pixClipRectangle(PIX *pixs, BOX *box, BOX **pboxc)
pixClipRectangle()
l_int32 barcodeFormatIsSupported(l_int32 format)
barcodeFormatIsSupported()
l_ok numaSetValue(NUMA *na, l_int32 index, l_float32 val)
numaSetValue()
l_ok numaSelectCrossingThreshold(NUMA *nax, NUMA *nay, l_float32 estthresh, l_float32 *pbestthresh)
numaSelectCrossingThreshold()
NUMA * pixExtractBarcodeWidths1(PIX *pixs, l_float32 thresh, l_float32 binfract, NUMA **pnaehist, NUMA **pnaohist, l_int32 debugflag)
pixExtractBarcodeWidths1()
BOXA * pixConnComp(PIX *pixs, PIXA **ppixa, l_int32 connectivity)
pixConnComp()
l_ok numaGetIValue(NUMA *na, l_int32 index, l_int32 *pival)
numaGetIValue()
l_ok pixaAddPix(PIXA *pixa, PIX *pix, l_int32 copyflag)
pixaAddPix()
PIX * pixXor(PIX *pixd, PIX *pixs1, PIX *pixs2)
pixXor()
l_int32 numaGetCount(NUMA *na)
numaGetCount()
l_ok sarrayAddString(SARRAY *sa, const char *string, l_int32 copyflag)
sarrayAddString()
PIX * pixDeskewBarcode(PIX *pixs, PIX *pixb, BOX *box, l_int32 margin, l_int32 threshold, l_float32 *pangle, l_float32 *pconf)
pixDeskewBarcode()
SARRAY * pixReadBarcodes(PIXA *pixa, l_int32 format, l_int32 method, SARRAY **psaw, l_int32 debugflag)
pixReadBarcodes()
PIX * pixaDisplayTiledInRows(PIXA *pixa, l_int32 outdepth, l_int32 maxwidth, l_float32 scalefactor, l_int32 background, l_int32 spacing, l_int32 border)
pixaDisplayTiledInRows()
SARRAY * pixProcessBarcodes(PIX *pixs, l_int32 format, l_int32 method, SARRAY **psaw, l_int32 debugflag)
pixProcessBarcodes()
l_ok numaInterpolateEqxInterval(l_float32 startx, l_float32 deltax, NUMA *nasy, l_int32 type, l_float32 x0, l_float32 x1, l_int32 npts, NUMA **pnax, NUMA **pnay)
numaInterpolateEqxInterval()
NUMA * pixReadBarcodeWidths(PIX *pixs, l_int32 method, l_int32 debugflag)
pixReadBarcodeWidths()
#define GET_DATA_BYTE(pdata, n)
NUMA * pixExtractBarcodeWidths2(PIX *pixs, l_float32 thresh, l_float32 *pwidth, NUMA **pnac, l_int32 debugflag)
pixExtractBarcodeWidths2()
l_ok gplotAddPlot(GPLOT *gplot, NUMA *nax, NUMA *nay, l_int32 plotstyle, const char *plotlabel)
gplotAddPlot()
static NUMA * pixAverageRasterScans(PIX *pixs, l_int32 nscans)
pixAverageRasterScans()
BOXA * pixLocateBarcodes(PIX *pixs, l_int32 thresh, PIX **ppixb, PIX **ppixm)
pixLocateBarcodes()
PIX * pixClone(PIX *pixs)
pixClone()
l_ok numaHistogramGetValFromRank(NUMA *na, l_float32 rank, l_float32 *prval)
numaHistogramGetValFromRank()
void pixDestroy(PIX **ppix)
pixDestroy()
PIX * pixRotateOrth(PIX *pixs, l_int32 quads)
pixRotateOrth()
BOX * boxaGetBox(BOXA *boxa, l_int32 index, l_int32 accessflag)
boxaGetBox()
static NUMA * numaGetPeakWidthLUT(NUMA *narange, NUMA *nacent)
numaGetPeakWidthLUT()
NUMA * numaCopy(NUMA *na)
numaCopy()
void numaDestroy(NUMA **pna)
numaDestroy()
PIX * pixOpenBrick(PIX *pixd, PIX *pixs, l_int32 hsize, l_int32 vsize)
pixOpenBrick()
NUMA * numaCrossingsByThreshold(NUMA *nax, NUMA *nay, l_float32 thresh)
numaCrossingsByThreshold()
l_ok pixGetDimensions(const PIX *pix, l_int32 *pw, l_int32 *ph, l_int32 *pd)
pixGetDimensions()
PIX * pixOr(PIX *pixd, PIX *pixs1, PIX *pixs2)
pixOr()
l_int32 sarrayGetCount(SARRAY *sa)
sarrayGetCount()
l_ok numaJoin(NUMA *nad, NUMA *nas, l_int32 istart, l_int32 iend)
numaJoin()
l_float32 * numaGetFArray(NUMA *na, l_int32 copyflag)
numaGetFArray()
static NUMA * numaGetPeakCentroids(NUMA *nahist, NUMA *narange)
numaGetPeakCentroids()
static NUMA * numaLocatePeakRanges(NUMA *nas, l_float32 minfirst, l_float32 minsep, l_float32 maxmin)
numaLocatePeakRanges()
PIX * pixaGetPix(PIXA *pixa, l_int32 index, l_int32 accesstype)
pixaGetPix()
l_ok boxaWriteStderr(BOXA *boxa)
boxaWriteStderr()
static l_int32 numaGetCrossingDistances(NUMA *nas, NUMA **pnaedist, NUMA **pnaodist, l_float32 *pmindist, l_float32 *pmaxdist)
numaGetCrossingDistances()
PIX * pixSobelEdgeFilter(PIX *pixs, l_int32 orientflag)
pixSobelEdgeFilter()
PIXA * pixExtractBarcodes(PIX *pixs, l_int32 debugflag)
pixExtractBarcodes()
void boxDestroy(BOX **pbox)
boxDestroy()
l_int32 boxaGetCount(BOXA *boxa)
boxaGetCount()
l_ok numaGetMax(NUMA *na, l_float32 *pmaxval, l_int32 *pimaxloc)
numaGetMax()
l_ok pixaAddBox(PIXA *pixa, BOX *box, l_int32 copyflag)
pixaAddBox()
l_ok boxGetGeometry(BOX *box, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxGetGeometry()
void pixaDestroy(PIXA **ppixa)
pixaDestroy()
BOX * boxCreate(l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxCreate()
l_int32 pixaGetCount(PIXA *pixa)
pixaGetCount()
l_ok numaWriteStderr(NUMA *na)
numaWriteStderr()
PIX * pixRotate(PIX *pixs, l_float32 angle, l_int32 type, l_int32 incolor, l_int32 width, l_int32 height)
pixRotate()
void sarrayDestroy(SARRAY **psa)
sarrayDestroy()