51 #include <config_auto.h>
55 #include "allheaders.h"
58 static void adjustSidePlotName(
char *buf,
size_t size,
const char *preface,
114 BOXA *boxae, *boxao, *boxamede, *boxamedo, *boxame, *boxamo, *boxad;
118 return (
BOXA *)ERROR_PTR(
"boxas not defined", __func__, NULL);
120 L_WARNING(
"halfwin must be > 0; returning copy\n", __func__);
124 L_WARNING(
"maxdiff must be >= 0; returning copy\n", __func__);
130 L_WARNING(
"invalid subflag; returning copy\n", __func__);
134 L_WARNING(
"need at least 6 boxes; returning copy\n", __func__);
162 pixWrite(
"/tmp/lept/smooth/plotsides1.png", pix1, IFF_PNG);
165 pixWrite(
"/tmp/lept/smooth/plotsides2.png", pix1, IFF_PNG);
168 pixWrite(
"/tmp/lept/smooth/plotsizes1.png", pix1, IFF_PNG);
171 pixWrite(
"/tmp/lept/smooth/plotsizes2.png", pix1, IFF_PNG);
208 l_int32 n, i, left, top, right, bot;
211 NUMA *nal, *nat, *nar, *nab, *naml, *namt, *namr, *namb;
215 return (
BOXA *)ERROR_PTR(
"boxas not defined", __func__, NULL);
217 L_WARNING(
"less than 3 boxes; returning a copy\n", __func__);
221 L_WARNING(
"halfwin must be > 0; returning copy\n", __func__);
227 return (
BOXA *)ERROR_PTR(
"filled boxa not made", __func__, NULL);
238 for (i = 0; i < n; i++) {
243 box =
boxCreate(left, top, right - left + 1, bot - top + 1);
250 pixWrite(
"/tmp/lept/windowed/plotsides1.png", pix1, IFF_PNG);
253 pixWrite(
"/tmp/lept/windowed/plotsides2.png", pix1, IFF_PNG);
256 pixWrite(
"/tmp/lept/windowed/plotsizes1.png", pix1, IFF_PNG);
259 pixWrite(
"/tmp/lept/windowed/plotsizes2.png", pix1, IFF_PNG);
353 l_int32 n, i, ls, ts, rs, bs, ws, hs, lm, tm, rm, bm, wm, hm, ld, td, rd, bd;
354 BOX *boxs, *boxm, *boxd, *boxempty;
358 return (
BOXA *)ERROR_PTR(
"boxas not defined", __func__, NULL);
360 L_WARNING(
"boxam not defined; returning copy", __func__);
366 L_WARNING(
"invalid subflag; returning copy", __func__);
371 L_WARNING(
"boxas and boxam sizes differ; returning copy", __func__);
377 for (i = 0; i < n; i++) {
380 if (!boxs || !boxm) {
400 ld = (L_ABS(lm - ls) <= maxdiff) ? ls : lm - extrapixels;
401 td = (L_ABS(tm - ts) <= maxdiff) ? ts : tm - extrapixels;
402 rd = (L_ABS(rm - rs) <= maxdiff) ? rs : rm + extrapixels;
403 bd = (L_ABS(bm - bs) <= maxdiff) ? bs : bm + extrapixels;
405 ld = (L_ABS(wm - ws) <= maxdiff) ? ls : lm - extrapixels;
406 td = (L_ABS(hm - hs) <= maxdiff) ? ts : tm - extrapixels;
407 rd = (L_ABS(wm - ws) <= maxdiff) ? rs : rm + extrapixels;
408 bd = (L_ABS(hm - hs) <= maxdiff) ? bs : bm + extrapixels;
410 ld = L_MAX(lm, L_MIN(ls, lm + maxdiff));
411 td = L_MAX(tm, L_MIN(ts, tm + maxdiff));
412 rd = L_MIN(rm, L_MAX(rs, rm - maxdiff));
413 bd = L_MIN(bm, L_MAX(bs, bm - maxdiff));
415 ld = L_MIN(lm, L_MAX(ls, lm - maxdiff));
416 td = L_MIN(tm, L_MAX(ts, tm - maxdiff));
417 rd = L_MAX(rm, L_MIN(rs, rm + maxdiff));
418 bd = L_MAX(bm, L_MIN(bs, bm + maxdiff));
420 boxd =
boxCreate(ld, td, rd - ld + 1, bd - td + 1);
467 l_int32 i, ne, no, nmin, xe, we, xo, wo, inde, indo, x, w;
469 BOXA *boxae, *boxao, *boxad;
472 return (
BOXA *)ERROR_PTR(
"boxas not defined", __func__, NULL);
474 L_WARNING(
"invalid factor; setting to 1.0\n", __func__);
484 nmin = L_MIN(ne, no);
485 for (i = 0; i < nmin; i++) {
493 if (inde == 0 && indo == 0)
continue;
499 if (we == 0 || wo == 0) {
503 }
else if (L_ABS(we - wo) > delw) {
505 if (we > wo && inde == 1) {
510 }
else if (we < wo && indo == 1) {
516 if (we < wo && inde == 1) {
519 x = L_MAX(0, xe + (we - w));
522 }
else if (we > wo && indo == 1) {
590 l_int32 i, n, bw1, bh1, bw2, bh2, npairs;
591 l_float32 ave, fdiff, sumdiff, med, fvarp, fvarm;
594 if (pfvarp) *pfvarp = 0.0;
595 if (pfvarm) *pfvarm = 0.0;
597 return ERROR_INT(
"&same not defined", __func__, 1);
600 return ERROR_INT(
"boxas not defined", __func__, 1);
602 return ERROR_INT(
"need a least 6 valid boxes", __func__, 1);
604 return ERROR_INT(
"invalid type", __func__, 1);
605 if (threshp < 0.0 || threshp >= 0.5)
606 return ERROR_INT(
"invalid threshp", __func__, 1);
607 if (threshm < 0.0 || threshm >= 0.5)
608 return ERROR_INT(
"invalid threshm", __func__, 1);
609 if (threshp == 0.0) threshp = 0.02;
610 if (threshm == 0.0) threshm = 0.015;
615 for (i = 0, npairs = 0, sumdiff = 0; i < n - 1; i += 2) {
618 if (bw1 == 0 || bh1 == 0 || bw2 == 0 || bh2 == 0)
622 ave = (bw1 + bw2) / 2.0;
623 fdiff = L_ABS(bw1 - bw2) / ave;
627 ave = (bh1 + bh2) / 2.0;
628 fdiff = L_ABS(bh1 - bh2) / ave;
634 fvarp = sumdiff / npairs;
635 if (pfvarp) *pfvarp = fvarp;
640 L_WARNING(
"median value is 0\n", __func__);
644 if (pfvarm) *pfvarm = fvarm;
649 if (fvarp < threshp && fvarm < threshm)
651 else if (fvarp < threshp && fvarm > threshm)
689 BOXA *boxa1e, *boxa1o, *boxa2e, *boxa2o, *boxa3e, *boxa3o, *boxad;
693 return (
BOXA *)ERROR_PTR(
"boxas not defined", __func__, NULL);
695 L_WARNING(
"invalid select1; returning copy\n", __func__);
699 L_WARNING(
"invalid select2; returning copy\n", __func__);
703 L_WARNING(
"thresh must be >= 0; returning copy\n", __func__);
707 L_WARNING(
"need at least 3 valid boxes; returning copy\n", __func__);
746 pixWrite(
"/tmp/lept/boxa/recon_sides.png", pix1, IFF_PNG);
800 l_int32 left, right, top, bot, medleft, medright, medtop, medbot;
806 return (
BOXA *)ERROR_PTR(
"boxas not defined", __func__, NULL);
810 L_WARNING(
"invalid select; returning copy\n", __func__);
814 L_WARNING(
"thresh must be >= 0; returning copy\n", __func__);
818 L_WARNING(
"need at least 3 valid boxes; returning copy\n", __func__);
841 if (ndb == 0 || ndb == 5) {
842 adjustSidePlotName(buf,
sizeof(buf),
"init", select);
852 for (i = 0; i < n; i++) {
855 diff = medleft - left;
856 if (L_ABS(diff) >= thresh)
862 for (i = 0; i < n; i++) {
865 diff = medright - right;
866 if (L_ABS(diff) >= thresh)
872 for (i = 0; i < n; i++) {
876 if (L_ABS(diff) >= thresh)
882 for (i = 0; i < n; i++) {
886 if (L_ABS(diff) >= thresh)
893 adjustSidePlotName(buf,
sizeof(buf),
"final", select);
902 adjustSidePlotName(
char *buf,
977 l_int32 i, n, ne, no, outfound, isvalid, ind, del, maxdel;
978 l_int32 medw, medh, bw, bh, left, right, top, bot;
979 l_int32 medleft, medlefte, medlefto, medright, medrighte, medrighto;
980 l_int32 medtop, medtope, medtopo, medbot, medbote, medboto;
983 BOXA *boxa1, *boxae, *boxao, *boxad;
984 NUMA *naind, *nadelw, *nadelh;
986 if (pnadelw) *pnadelw = NULL;
987 if (pnadelh) *pnadelh = NULL;
988 if (pratiowh) *pratiowh = 0.0;
990 return (
BOXA *)ERROR_PTR(
"boxas not defined", __func__, NULL);
993 L_WARNING(
"invalid type; returning copy\n", __func__);
996 if (dfract <= 0.0 || dfract >= 0.5) {
997 L_WARNING(
"invalid dimensional fract; returning copy\n", __func__);
1000 if (sfract <= 0.0 || sfract >= 0.5) {
1001 L_WARNING(
"invalid side fract; returning copy\n", __func__);
1004 if (factor < 0.8 || factor > 1.25)
1005 L_WARNING(
"factor %5.3f is typ. closer to 1.0\n", __func__, factor);
1007 L_WARNING(
"need at least 6 valid boxes; returning copy\n", __func__);
1015 factor, pnadelw, NULL, pratiowh);
1017 factor, NULL, pnadelh, NULL);
1031 *pratiowh = (l_float32)medw / (l_float32)medh;
1032 L_INFO(
"median ratio w/h = %5.3f\n", __func__, *pratiowh);
1040 for (i = 0; i < n; i++) {
1046 brat = (l_float32)bw / (l_float32)medw;
1047 if (brat < 1.0 - dfract || brat > 1.0 + dfract) {
1063 L_INFO(
"no width outlier boxes found\n", __func__);
1074 L_INFO(
"fixing width of outlier boxes\n", __func__);
1075 medlefte = medrighte = medlefto = medrighto = 0;
1083 medlefte = medlefto;
1084 medrighte = medrighto;
1085 }
else if (no == 0) {
1086 medlefto = medlefte;
1087 medrighto = medrighte;
1097 maxdel = (l_int32)(sfract * medw + 0.5);
1098 for (i = 0; i < n; i++) {
1102 medleft = (i % 2 == 0) ? medlefte : medlefto;
1103 medright = (i % 2 == 0) ? medrighte : medrighto;
1104 if (ind == 1 && isvalid) {
1106 if (L_ABS(left - medleft) > maxdel) left = medleft;
1107 if (L_ABS(right - medright) > maxdel) right = medright;
1108 del = (l_int32)(factor * medw - (right - left)) / 2;
1118 *pratiowh = (l_float32)medw / (l_float32)medh;
1119 L_INFO(
"median ratio w/h = %5.3f\n", __func__, *pratiowh);
1127 for (i = 0; i < n; i++) {
1133 brat = (l_float32)bh / (l_float32)medh;
1134 if (brat < 1.0 - dfract || brat > 1.0 + dfract) {
1150 L_INFO(
"no height outlier boxes found\n", __func__);
1161 L_INFO(
"fixing height of outlier boxes\n", __func__);
1162 medlefte = medtope = medbote = medtopo = medboto = 0;
1172 }
else if (no == 0) {
1185 maxdel = (l_int32)(sfract * medh + 0.5);
1186 for (i = 0; i < n; i++) {
1190 medtop = (i % 2 == 0) ? medtope : medtopo;
1191 medbot = (i % 2 == 0) ? medbote : medboto;
1192 if (ind == 1 && isvalid) {
1194 if (L_ABS(top - medtop) > maxdel) top = medtop;
1195 if (L_ABS(bot - medbot) > maxdel) bot = medbot;
1196 del = (l_int32)(factor * medh - (bot - top)) / 2;
1236 const char *plotname,
1243 char buf[128], titlebuf[128];
1245 static l_int32 plotid = 0;
1246 l_int32 n, i, w, h, left, top, right, bot;
1247 l_int32 debugprint = FALSE;
1251 NUMA *nal, *nat, *nar, *nab;
1253 if (pnal) *pnal = NULL;
1254 if (pnat) *pnat = NULL;
1255 if (pnar) *pnar = NULL;
1256 if (pnab) *pnab = NULL;
1257 if (ppixd) *ppixd = NULL;
1259 return ERROR_INT(
"boxa not defined", __func__, 1);
1261 return ERROR_INT(
"less than 2 boxes", __func__, 1);
1263 return ERROR_INT(
"&pixd not defined", __func__, 1);
1273 for (i = 0; i < n; i++) {
1275 right = left + w - 1;
1286 snprintf(buf,
sizeof(buf),
"/tmp/lept/plots/sides.%s", plotname);
1287 snprintf(titlebuf,
sizeof(titlebuf),
"%s: Box sides vs. box index",
1290 snprintf(buf,
sizeof(buf),
"/tmp/lept/plots/sides.%d", plotid++);
1291 snprintf(titlebuf,
sizeof(titlebuf),
"Box sides vs. box index");
1294 "box index",
"side location");
1295 gplotAddPlot(gplot, NULL, nal, GPLOT_LINES,
"left side");
1296 gplotAddPlot(gplot, NULL, nat, GPLOT_LINES,
"top side");
1297 gplotAddPlot(gplot, NULL, nar, GPLOT_LINES,
"right side");
1298 gplotAddPlot(gplot, NULL, nab, GPLOT_LINES,
"bottom side");
1306 lept_stderr(
"%s left: med = %7.3f, meandev = %7.3f\n",
1307 dataname, med, dev);
1310 lept_stderr(
"%s top: med = %7.3f, meandev = %7.3f\n",
1311 dataname, med, dev);
1314 lept_stderr(
"%s right: med = %7.3f, meandev = %7.3f\n",
1315 dataname, med, dev);
1318 lept_stderr(
"%s bot: med = %7.3f, meandev = %7.3f\n",
1319 dataname, med, dev);
1320 LEPT_FREE(dataname);
1367 const char *plotname,
1372 char buf[128], titlebuf[128];
1373 static l_int32 plotid = 0;
1379 if (pnaw) *pnaw = NULL;
1380 if (pnah) *pnah = NULL;
1381 if (ppixd) *ppixd = NULL;
1383 return ERROR_INT(
"boxa not defined", __func__, 1);
1385 return ERROR_INT(
"less than 2 boxes", __func__, 1);
1387 return ERROR_INT(
"&pixd not defined", __func__, 1);
1394 for (i = 0; i < n; i++) {
1403 snprintf(buf,
sizeof(buf),
"/tmp/lept/plots/size.%s", plotname);
1404 snprintf(titlebuf,
sizeof(titlebuf),
"%s: Box size vs. box index",
1407 snprintf(buf,
sizeof(buf),
"/tmp/lept/plots/size.%d", plotid++);
1408 snprintf(titlebuf,
sizeof(titlebuf),
"Box size vs. box index");
1411 "box index",
"box dimension");
1453 BOXA *boxae, *boxao, *boxad;
1456 return (
BOXA *)ERROR_PTR(
"boxas not defined", __func__, NULL);
1458 return (
BOXA *)ERROR_PTR(
"invalid useflag", __func__, NULL);
1465 L_INFO(
"%d valid boxes, %d invalid boxes\n", __func__, nv, n - nv);
1467 L_WARNING(
"n < 3; some invalid\n", __func__);
1485 L_WARNING(
"there are still %d invalid boxes\n", __func__, n - nv);
1507 l_int32 n, nv, i, j, spandown, spanup;
1512 return ERROR_INT(
"boxa not defined", __func__, 1);
1515 if (n == nv)
return 0;
1517 L_WARNING(
"no valid boxes out of %d boxes\n", __func__, n);
1522 if ((indic = (l_int32 *)LEPT_CALLOC(n,
sizeof(l_int32))) == NULL)
1523 return ERROR_INT(
"indic not made", __func__, 1);
1524 for (i = 0; i < n; i++) {
1532 for (i = 0; i < n; i++) {
1535 spandown = spanup = 10000000;
1536 for (j = i - 1; j >= 0; j--) {
1537 if (indic[j] == 1) {
1542 for (j = i + 1; j < n; j++) {
1543 if (indic[j] == 1) {
1548 if (spandown < spanup)
1589 l_float32 *pdel_evenodd,
1590 l_float32 *prms_even,
1591 l_float32 *prms_odd,
1592 l_float32 *prms_all)
1594 l_int32 n, ne, no, nmin, vale, valo, i;
1596 BOXA *boxae, *boxao;
1597 NUMA *nae, *nao, *na_all;
1599 if (pdel_evenodd) *pdel_evenodd = 0.0;
1600 if (prms_even) *prms_even = 0.0;
1601 if (prms_odd) *prms_odd = 0.0;
1602 if (prms_all) *prms_all = 0.0;
1604 return ERROR_INT(
"boxa not defined", __func__, 1);
1606 return ERROR_INT(
"invalid type", __func__, 1);
1607 if (!pdel_evenodd && !prms_even && !prms_odd && !prms_all)
1608 return ERROR_INT(
"nothing to do", __func__, 1);
1611 return ERROR_INT(
"too few boxes", __func__, 1);
1616 nmin = L_MIN(ne, no);
1620 return ERROR_INT(
"either no even or no odd boxes", __func__, 1);
1635 for (i = 0; i < nmin; i++) {
1638 sum += L_ABS(vale - valo);
1640 *pdel_evenodd = sum / nmin;
1698 l_int32 i, n, bw, bh, medw, medh, medwe, medwo, medhe, medho;
1699 BOXA *boxae, *boxao;
1700 NUMA *nadelw, *nadelh;
1702 if (pmedw) *pmedw = 0;
1703 if (pmedh) *pmedh = 0;
1704 if (pmedwe) *pmedwe= 0;
1705 if (pmedwo) *pmedwo= 0;
1706 if (pmedhe) *pmedhe= 0;
1707 if (pmedho) *pmedho= 0;
1708 if (pnadelw) *pnadelw = NULL;
1709 if (pnadelh) *pnadelh = NULL;
1711 return ERROR_INT(
"boxas not defined", __func__, 1);
1713 return ERROR_INT(
"need at least 6 valid boxes", __func__, 1);
1720 return ERROR_INT(
"don't have 3+ valid boxes of each type", __func__, 1);
1727 if (pmedw) *pmedw = medw;
1728 if (pmedh) *pmedh = medh;
1729 if (pmedwe) *pmedwe = medwe;
1730 if (pmedwo) *pmedwo = medwo;
1731 if (pmedhe) *pmedhe = medhe;
1732 if (pmedho) *pmedho = medho;
1738 for (i = 0; i < n; i++) {
1740 if (bw == 0 || bh == 0) {
l_int32 boxaGetValidCount(BOXA *boxa)
boxaGetValidCount()
l_ok boxGetGeometry(const BOX *box, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxGetGeometry()
BOXA * boxaCopy(BOXA *boxa, l_int32 copyflag)
boxaCopy()
void boxDestroy(BOX **pbox)
boxDestroy()
l_ok boxaReplaceBox(BOXA *boxa, l_int32 index, BOX *box)
boxaReplaceBox()
l_ok boxGetSideLocations(const BOX *box, l_int32 *pl, l_int32 *pr, l_int32 *pt, l_int32 *pb)
boxGetSideLocations()
l_ok boxaGetBoxGeometry(BOXA *boxa, l_int32 index, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxaGetBoxGeometry()
l_ok boxaWriteDebug(const char *filename, BOXA *boxa)
boxaWriteDebug()
l_ok boxaAddBox(BOXA *boxa, BOX *box, l_int32 copyflag)
boxaAddBox()
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
l_int32 boxaGetCount(const BOXA *boxa)
boxaGetCount()
l_ok boxIsValid(BOX *box, l_int32 *pvalid)
boxIsValid()
l_ok boxSetGeometry(BOX *box, l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxSetGeometry()
BOX * boxaGetValidBox(BOXA *boxa, l_int32 index, l_int32 accessflag)
boxaGetValidBox()
BOX * boxaGetBox(BOXA *boxa, l_int32 index, l_int32 accessflag)
boxaGetBox()
BOX * boxCreate(l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxCreate()
BOXA * boxaCreate(l_int32 n)
boxaCreate()
BOXA * boxaMergeEvenOdd(BOXA *boxae, BOXA *boxao, l_int32 fillflag)
boxaMergeEvenOdd()
l_ok boxSetSide(BOX *boxs, l_int32 side, l_int32 val, l_int32 thresh)
boxSetSide()
BOX * boxAdjustSides(BOX *boxd, BOX *boxs, l_int32 delleft, l_int32 delright, l_int32 deltop, l_int32 delbot)
boxAdjustSides()
l_ok boxaSplitEvenOdd(BOXA *boxa, l_int32 fillflag, BOXA **pboxae, BOXA **pboxao)
boxaSplitEvenOdd()
l_ok boxaGetMedianVals(BOXA *boxa, l_int32 *px, l_int32 *py, l_int32 *pr, l_int32 *pb, l_int32 *pw, l_int32 *ph)
boxaGetMedianVals()
l_ok boxaExtractAsNuma(BOXA *boxa, NUMA **pnal, NUMA **pnat, NUMA **pnar, NUMA **pnab, NUMA **pnaw, NUMA **pnah, l_int32 keepinvalid)
boxaExtractAsNuma()
l_ok boxaGetSizes(BOXA *boxa, NUMA **pnaw, NUMA **pnah)
boxaGetSizes()
l_ok boxaSizeConsistency(BOXA *boxas, l_int32 type, l_float32 threshp, l_float32 threshm, l_float32 *pfvarp, l_float32 *pfvarm, l_int32 *psame)
boxaSizeConsistency()
BOXA * boxaModifyWithBoxa(BOXA *boxas, BOXA *boxam, l_int32 subflag, l_int32 maxdiff, l_int32 extrapixels)
boxaModifyWithBoxa()
BOXA * boxaReconcileAllByMedian(BOXA *boxas, l_int32 select1, l_int32 select2, l_int32 thresh, l_int32 extra, PIXA *pixadb)
boxaReconcileAllByMedian()
l_ok boxaPlotSides(BOXA *boxa, const char *plotname, NUMA **pnal, NUMA **pnat, NUMA **pnar, NUMA **pnab, PIX **ppixd)
boxaPlotSides()
BOXA * boxaReconcileSidesByMedian(BOXA *boxas, l_int32 select, l_int32 thresh, l_int32 extra, PIXA *pixadb)
boxaReconcileSidesByMedian()
l_ok boxaMedianDimensions(BOXA *boxas, l_int32 *pmedw, l_int32 *pmedh, l_int32 *pmedwe, l_int32 *pmedwo, l_int32 *pmedhe, l_int32 *pmedho, NUMA **pnadelw, NUMA **pnadelh)
boxaMedianDimensions()
BOXA * boxaSmoothSequenceMedian(BOXA *boxas, l_int32 halfwin, l_int32 subflag, l_int32 maxdiff, l_int32 extrapixels, l_int32 debug)
boxaSmoothSequenceMedian()
l_ok boxaPlotSizes(BOXA *boxa, const char *plotname, NUMA **pnaw, NUMA **pnah, PIX **ppixd)
boxaPlotSizes()
l_ok boxaSizeVariation(BOXA *boxa, l_int32 type, l_float32 *pdel_evenodd, l_float32 *prms_even, l_float32 *prms_odd, l_float32 *prms_all)
boxaSizeVariation()
BOXA * boxaReconcilePairWidth(BOXA *boxas, l_int32 delw, l_int32 op, l_float32 factor, NUMA *na)
boxaReconcilePairWidth()
BOXA * boxaWindowedMedian(BOXA *boxas, l_int32 halfwin, l_int32 debug)
boxaWindowedMedian()
BOXA * boxaFillSequence(BOXA *boxas, l_int32 useflag, l_int32 debug)
boxaFillSequence()
static l_int32 boxaFillAll(BOXA *boxa)
boxaFillAll()
BOXA * boxaReconcileSizeByMedian(BOXA *boxas, l_int32 type, l_float32 dfract, l_float32 sfract, l_float32 factor, NUMA **pnadelw, NUMA **pnadelh, l_float32 *pratiowh)
boxaReconcileSizeByMedian()
l_ok gplotAddPlot(GPLOT *gplot, NUMA *nax, NUMA *nay, l_int32 plotstyle, const char *plotlabel)
gplotAddPlot()
GPLOT * gplotCreate(const char *rootname, l_int32 outformat, const char *title, const char *xlabel, const char *ylabel)
gplotCreate()
PIX * gplotMakeOutputPix(GPLOT *gplot)
gplotMakeOutputPix()
void gplotDestroy(GPLOT **pgplot)
gplotDestroy()
l_ok numaAddNumber(NUMA *na, l_float32 val)
numaAddNumber()
NUMA * numaCreate(l_int32 n)
numaCreate()
void numaDestroy(NUMA **pna)
numaDestroy()
l_ok numaGetIValue(NUMA *na, l_int32 index, l_int32 *pival)
numaGetIValue()
l_ok numaGetMedian(NUMA *na, l_float32 *pval)
numaGetMedian()
l_ok numaGetMeanDevFromMedian(NUMA *na, l_float32 med, l_float32 *pdev)
numaGetMeanDevFromMedian()
NUMA * numaWindowedMedian(NUMA *nas, l_int32 halfwin)
numaWindowedMedian()
l_ok numaSimpleStats(NUMA *na, l_int32 first, l_int32 last, l_float32 *pmean, l_float32 *pvar, l_float32 *prvar)
numaSimpleStats()
void pixDestroy(PIX **ppix)
pixDestroy()
@ L_USE_SAME_PARITY_BOXES
@ L_ADJUST_LEFT_AND_RIGHT
l_ok pixaAddPix(PIXA *pixa, PIX *pix, l_int32 copyflag)
pixaAddPix()
l_int32 pixaGetCount(PIXA *pixa)
pixaGetCount()
PIX * pixaDisplayTiledInColumns(PIXA *pixas, l_int32 nx, l_float32 scalefactor, l_int32 spacing, l_int32 border)
pixaDisplayTiledInColumns()
void lept_stderr(const char *fmt,...)
lept_stderr()
char * stringNew(const char *src)
stringNew()
l_int32 stringCat(char *dest, size_t size, const char *src)
stringCat()
l_int32 lept_mkdir(const char *subdir)
lept_mkdir()
l_ok stringCopy(char *dest, const char *src, l_int32 n)
stringCopy()