68 #include <config_auto.h>
72 #include "allheaders.h"
77 static const l_int32 MinCompsForBinSort = 200;
112 PROCNAME(
"boxaTransform");
115 return (
BOXA *)ERROR_PTR(
"boxas not defined", procName, NULL);
118 return (
BOXA *)ERROR_PTR(
"boxad not made", procName, NULL);
119 for (i = 0; i < n; i++) {
122 return (
BOXA *)ERROR_PTR(
"boxs not found", procName, NULL);
124 boxd =
boxTransform(boxs, shiftx, shifty, scalex, scaley);
158 PROCNAME(
"boxTransform");
161 return (
BOX *)ERROR_PTR(
"box not defined", procName, NULL);
162 if (box->
w <= 0 || box->
h <= 0)
165 return boxCreate((l_int32)(L_MAX(0, scalex * (box->
x + shiftx) + 0.5)),
166 (l_int32)(L_MAX(0, scaley * (box->
y + shifty) + 0.5)),
167 (l_int32)(L_MAX(1.0, scalex * box->
w + 0.5)),
168 (l_int32)(L_MAX(1.0, scaley * box->
h + 0.5)));
220 PROCNAME(
"boxaTransformOrdered");
223 return (
BOXA *)ERROR_PTR(
"boxas not defined", procName, NULL);
226 return (
BOXA *)ERROR_PTR(
"boxad not made", procName, NULL);
227 for (i = 0; i < n; i++) {
230 return (
BOXA *)ERROR_PTR(
"boxs not found", procName, NULL);
233 xcen, ycen, angle, order);
306 l_int32 bx, by, bw, bh, tx, ty, tw, th;
307 l_int32 xcent, ycent;
308 l_float32 sina, cosa, xdif, ydif, rx, ry, rw, rh;
311 PROCNAME(
"boxTransformOrdered");
314 return (
BOX *)ERROR_PTR(
"boxs not defined", procName, NULL);
317 return (
BOX *)ERROR_PTR(
"order invalid", procName, NULL);
320 if (bw <= 0 || bh <= 0)
328 tx = (l_int32)(scalex * (bx + shiftx) + 0.5);
329 ty = (l_int32)(scaley * (by + shifty) + 0.5);
330 tw = (l_int32)(L_MAX(1.0, scalex * bw + 0.5));
331 th = (l_int32)(L_MAX(1.0, scaley * bh + 0.5));
332 xcent = (l_int32)(scalex * xcen + 0.5);
333 ycent = (l_int32)(scaley * ycen + 0.5);
337 xdif = tx + 0.5 * tw - xcent;
338 ydif = ty + 0.5 * th - ycent;
339 rw = L_ABS(tw * cosa) + L_ABS(th * sina);
340 rh = L_ABS(th * cosa) + L_ABS(tw * sina);
341 rx = xcent + xdif * cosa - ydif * sina - 0.5 * rw;
342 ry = ycent + ydif * cosa + xdif * sina - 0.5 * rh;
343 boxd =
boxCreate((l_int32)rx, (l_int32)ry, (l_int32)rw,
347 tx = (l_int32)(scalex * bx + shiftx + 0.5);
348 ty = (l_int32)(scaley * by + shifty + 0.5);
349 tw = (l_int32)(L_MAX(1.0, scalex * bw + 0.5));
350 th = (l_int32)(L_MAX(1.0, scaley * bh + 0.5));
351 xcent = (l_int32)(scalex * xcen + 0.5);
352 ycent = (l_int32)(scaley * ycen + 0.5);
356 xdif = tx + 0.5 * tw - xcent;
357 ydif = ty + 0.5 * th - ycent;
358 rw = L_ABS(tw * cosa) + L_ABS(th * sina);
359 rh = L_ABS(th * cosa) + L_ABS(tw * sina);
360 rx = xcent + xdif * cosa - ydif * sina - 0.5 * rw;
361 ry = ycent + ydif * cosa + xdif * sina - 0.5 * rh;
362 boxd =
boxCreate((l_int32)rx, (l_int32)ry, (l_int32)rw,
372 xdif = bx + 0.5 * bw - xcen;
373 ydif = by + 0.5 * bh - ycen;
374 rw = L_ABS(bw * cosa) + L_ABS(bh * sina);
375 rh = L_ABS(bh * cosa) + L_ABS(bw * sina);
376 rx = xcen + xdif * cosa - ydif * sina - 0.5 * rw;
377 ry = ycen + ydif * cosa + xdif * sina - 0.5 * rh;
379 tx = (l_int32)(scalex * (rx + shiftx) + 0.5);
380 ty = (l_int32)(scaley * (ry + shifty) + 0.5);
381 tw = (l_int32)(L_MAX(1.0, scalex * rw + 0.5));
382 th = (l_int32)(L_MAX(1.0, scaley * rh + 0.5));
391 xdif = bx + 0.5 * bw - xcen;
392 ydif = by + 0.5 * bh - ycen;
393 rw = L_ABS(bw * cosa) + L_ABS(bh * sina);
394 rh = L_ABS(bh * cosa) + L_ABS(bw * sina);
395 rx = xcen + xdif * cosa - ydif * sina - 0.5 * rw;
396 ry = ycen + ydif * cosa + xdif * sina - 0.5 * rh;
398 tx = (l_int32)(scalex * rx + shiftx + 0.5);
399 ty = (l_int32)(scaley * ry + shifty + 0.5);
400 tw = (l_int32)(L_MAX(1.0, scalex * rw + 0.5));
401 th = (l_int32)(L_MAX(1.0, scaley * rh + 0.5));
412 xdif = tx + 0.5 * bw - xcen;
413 ydif = ty + 0.5 * bh - ycen;
414 rw = L_ABS(bw * cosa) + L_ABS(bh * sina);
415 rh = L_ABS(bh * cosa) + L_ABS(bw * sina);
416 rx = xcen + xdif * cosa - ydif * sina - 0.5 * rw;
417 ry = ycen + ydif * cosa + xdif * sina - 0.5 * rh;
419 tx = (l_int32)(scalex * rx + 0.5);
420 ty = (l_int32)(scaley * ry + 0.5);
421 tw = (l_int32)(L_MAX(1.0, scalex * rw + 0.5));
422 th = (l_int32)(L_MAX(1.0, scaley * rh + 0.5));
425 tx = (l_int32)(scalex * bx + 0.5);
426 ty = (l_int32)(scaley * by + 0.5);
427 tw = (l_int32)(L_MAX(1.0, scalex * bw + 0.5));
428 th = (l_int32)(L_MAX(1.0, scaley * bh + 0.5));
429 xcent = (l_int32)(scalex * xcen + 0.5);
430 ycent = (l_int32)(scaley * ycen + 0.5);
437 xdif = tx + 0.5 * tw - xcent;
438 ydif = ty + 0.5 * th - ycent;
439 rw = L_ABS(tw * cosa) + L_ABS(th * sina);
440 rh = L_ABS(th * cosa) + L_ABS(tw * sina);
441 rx = xcent + xdif * cosa - ydif * sina - 0.5 * rw;
442 ry = ycent + ydif * cosa + xdif * sina - 0.5 * rh;
444 tx = (l_int32)(rx + shiftx + 0.5);
445 ty = (l_int32)(ry + shifty + 0.5);
446 tw = (l_int32)(rw + 0.5);
447 th = (l_int32)(rh + 0.5);
479 PROCNAME(
"boxaRotateOrth");
482 return (
BOXA *)ERROR_PTR(
"boxas not defined", procName, NULL);
483 if (rotation < 0 || rotation > 3)
484 return (
BOXA *)ERROR_PTR(
"rotation not in {0,1,2,3}", procName, NULL);
490 return (
BOXA *)ERROR_PTR(
"boxad not made", procName, NULL);
491 for (i = 0; i < n; i++) {
494 return (
BOXA *)ERROR_PTR(
"boxs not found", procName, NULL);
527 l_int32 bx, by, bw, bh, xdist, ydist;
529 PROCNAME(
"boxRotateOrth");
532 return (
BOX *)ERROR_PTR(
"box not defined", procName, NULL);
533 if (rotation < 0 || rotation > 3)
534 return (
BOX *)ERROR_PTR(
"rotation not in {0,1,2,3}", procName, NULL);
539 if (bw <= 0 || bh <= 0)
545 else if (rotation == 2)
581 l_int32 i, n, x, y, full;
585 PROCNAME(
"boxaShiftWithPta");
588 return (
BOXA *)ERROR_PTR(
"boxas not defined", procName, NULL);
591 return (
BOXA *)ERROR_PTR(
"boxas not full", procName, NULL);
593 return (
BOXA *)ERROR_PTR(
"pta not defined", procName, NULL);
594 if (dir != 1 && dir != -1)
595 return (
BOXA *)ERROR_PTR(
"invalid dir", procName, NULL);
598 return (
BOXA *)ERROR_PTR(
"boxas and pta not same size", procName, NULL);
601 return (
BOXA *)ERROR_PTR(
"boxad not made", procName, NULL);
602 for (i = 0; i < n; i++) {
642 l_int32 i, n, x, y, w, h, size;
646 PROCNAME(
"boxaSort");
648 if (pnaindex) *pnaindex = NULL;
650 return (
BOXA *)ERROR_PTR(
"boxas not defined", procName, NULL);
652 L_WARNING(
"boxas is empty\n", procName);
663 return (
BOXA *)ERROR_PTR(
"invalid sort type", procName, NULL);
665 return (
BOXA *)ERROR_PTR(
"invalid sort order", procName, NULL);
668 if (n > MinCompsForBinSort &&
672 return boxaBinSort(boxas, sorttype, sortorder, pnaindex);
676 return (
BOXA *)ERROR_PTR(
"na not made", procName, NULL);
677 for (i = 0; i < n; i++) {
719 L_WARNING(
"invalid sort type\n", procName);
727 return (
BOXA *)ERROR_PTR(
"naindex not made", procName, NULL);
766 l_int32 i, n, x, y, w, h;
770 PROCNAME(
"boxaBinSort");
772 if (pnaindex) *pnaindex = NULL;
774 return (
BOXA *)ERROR_PTR(
"boxas not defined", procName, NULL);
776 L_WARNING(
"boxas is empty\n", procName);
782 return (
BOXA *)ERROR_PTR(
"invalid sort type", procName, NULL);
784 return (
BOXA *)ERROR_PTR(
"invalid sort order", procName, NULL);
788 return (
BOXA *)ERROR_PTR(
"na not made", procName, NULL);
789 for (i = 0; i < n; i++) {
809 L_WARNING(
"invalid sort type\n", procName);
817 return (
BOXA *)ERROR_PTR(
"naindex not made", procName, NULL);
845 PROCNAME(
"boxaSortByIndex");
848 return (
BOXA *)ERROR_PTR(
"boxas not defined", procName, NULL);
850 L_WARNING(
"boxas is empty\n", procName);
854 return (
BOXA *)ERROR_PTR(
"naindex not defined", procName, NULL);
857 for (i = 0; i < n; i++) {
921 l_int32 i, index, h, nt, ne, n, m, ival;
923 BOXA *boxa, *boxae, *boxan, *boxa1, *boxa2, *boxa3, *boxav, *boxavs;
924 BOXAA *baa, *baa1, *baad;
925 NUMA *naindex, *nae, *nan, *nah, *nav, *na1, *na2, *nad, *namap;
926 NUMAA *naa, *naa1, *naad;
928 PROCNAME(
"boxaSort2d");
930 if (pnaad) *pnaad = NULL;
932 return (
BOXAA *)ERROR_PTR(
"boxas not defined", procName, NULL);
934 return (
BOXAA *)ERROR_PTR(
"boxas is empty", procName, NULL);
939 return (
BOXAA *)ERROR_PTR(
"boxa not made", procName, NULL);
947 for (i = 0; i < nt; i++) {
974 for (i = 0; i < ne; i++) {
1007 for (i = 0; i < n; i++) {
1024 for (i = 0; i < n; i++) {
1041 for (i = 0; i < m; i++) {
1061 for (i = 0; i < m; i++) {
1068 for (i = 0; i < m; i++) {
1105 l_int32 ntot, boxtot, i, j, n, nn, index;
1111 PROCNAME(
"boxaSort2dByIndex");
1114 return (
BOXAA *)ERROR_PTR(
"boxas not defined", procName, NULL);
1116 return (
BOXAA *)ERROR_PTR(
"boxas is empty", procName, NULL);
1118 return (
BOXAA *)ERROR_PTR(
"naindex not defined", procName, NULL);
1123 return (
BOXAA *)ERROR_PTR(
"element count mismatch", procName, NULL);
1127 for (i = 0; i < n; i++) {
1131 for (j = 0; j < nn; j++) {
1178 l_int32 keepinvalid)
1180 l_int32 i, n, left, top, right, bot, w, h;
1182 PROCNAME(
"boxaExtractAsNuma");
1184 if (!pnal && !pnat && !pnar && !pnab && !pnaw && !pnah)
1185 return ERROR_INT(
"no output requested", procName, 1);
1186 if (pnal) *pnal = NULL;
1187 if (pnat) *pnat = NULL;
1188 if (pnar) *pnar = NULL;
1189 if (pnab) *pnab = NULL;
1190 if (pnaw) *pnaw = NULL;
1191 if (pnah) *pnah = NULL;
1193 return ERROR_INT(
"boxa not defined", procName, 1);
1195 return ERROR_INT(
"no valid boxes", procName, 1);
1204 for (i = 0; i < n; i++) {
1206 if (!keepinvalid && (w <= 0 || h <= 0))
1208 right = left + w - 1;
1259 l_int32 keepinvalid)
1261 l_int32 i, n, left, top, right, bot, w, h;
1263 PROCNAME(
"boxaExtractAsPta");
1265 if (!pptal && !pptar && !pptat && !pptab && !pptaw && !pptah)
1266 return ERROR_INT(
"no output requested", procName, 1);
1267 if (pptal) *pptal = NULL;
1268 if (pptat) *pptat = NULL;
1269 if (pptar) *pptar = NULL;
1270 if (pptab) *pptab = NULL;
1271 if (pptaw) *pptaw = NULL;
1272 if (pptah) *pptah = NULL;
1274 return ERROR_INT(
"boxa not defined", procName, 1);
1276 return ERROR_INT(
"no valid boxes", procName, 1);
1285 for (i = 0; i < n; i++) {
1287 if (!keepinvalid && (w <= 0 || h <= 0))
1289 right = left + w - 1;
1291 if (pptal)
ptaAddPt(*pptal, i, left);
1292 if (pptat)
ptaAddPt(*pptat, i, top);
1293 if (pptar)
ptaAddPt(*pptar, i, right);
1294 if (pptab)
ptaAddPt(*pptab, i, bot);
1325 l_int32 i, n, left, top, right, bot, w, h;
1328 PROCNAME(
"boxaExtractCorners");
1331 return (
PTA *)ERROR_PTR(
"boxa not defined", procName, NULL);
1334 return (
PTA *)ERROR_PTR(
"invalid location", procName, NULL);
1338 return (
PTA *)ERROR_PTR(
"pta not made", procName, NULL);
1340 for (i = 0; i < n; i++) {
1342 right = left + w - 1;
1344 if (w == 0 || h == 0) {
1359 ptaAddPt(pta, (left + right) / 2, (top + bot) / 2);
1410 l_float32 xval, yval, rval, bval, wval, hval;
1411 NUMA *nax, *nay, *nar, *nab, *naw, *nah;
1413 PROCNAME(
"boxaGetRankVals");
1422 return ERROR_INT(
"boxa not defined", procName, 1);
1423 if (fract < 0.0 || fract > 1.0)
1424 return ERROR_INT(
"fract not in [0.0 ... 1.0]", procName, 1);
1426 return ERROR_INT(
"no valid boxes in boxa", procName, 1);
1433 *px = (l_int32)xval;
1437 *py = (l_int32)yval;
1441 *pr = (l_int32)rval;
1445 *pb = (l_int32)bval;
1449 *pw = (l_int32)wval;
1453 *ph = (l_int32)hval;
1491 PROCNAME(
"boxaGetMedianVals");
1494 return ERROR_INT(
"boxa not defined", procName, 1);
1496 return ERROR_INT(
"no valid boxes in boxa", procName, 1);
1515 l_int32 i, n, bw, bh;
1516 l_float32 sumw, sumh;
1518 PROCNAME(
"boxaGetAverageSize");
1523 return ERROR_INT(
"boxa not defined", procName, 1);
1525 return ERROR_INT(
"boxa is empty", procName, 1);
1528 for (i = 0; i < n; i++) {
1534 if (pw) *pw = sumw / n;
1535 if (ph) *ph = sumh / n;
1572 l_int32 i, n, x, y, w, h, xmax, ymax, xmin, ymin, found;
1576 PROCNAME(
"boxaaGetExtent");
1578 if (!pw && !ph && !pbox && !pboxa)
1579 return ERROR_INT(
"no ptrs defined", procName, 1);
1582 if (pbox) *pbox = NULL;
1583 if (pboxa) *pboxa = NULL;
1585 return ERROR_INT(
"baa not defined", procName, 1);
1589 return ERROR_INT(
"no boxa in baa", procName, 1);
1593 xmin = ymin = 100000000;
1595 for (i = 0; i < n; i++) {
1600 if (w > 0 && h > 0) {
1602 xmin = L_MIN(xmin, x);
1603 ymin = L_MIN(ymin, y);
1604 xmax = L_MAX(xmax, x + w);
1605 ymax = L_MAX(ymax, y + h);
1615 *pbox =
boxCreate(xmin, ymin, xmax - xmin, ymax - ymin);
1655 PROCNAME(
"boxaaFlattenToBoxa");
1657 if (pnaindex) *pnaindex = NULL;
1659 return (
BOXA *)ERROR_PTR(
"baa not defined", procName, NULL);
1661 return (
BOXA *)ERROR_PTR(
"invalid copyflag", procName, NULL);
1664 *pnaindex = naindex;
1669 for (i = 0; i < n; i++) {
1678 for (j = 0; j < m; j++) {
1717 l_int32 i, j, m, n, mval, nshort;
1718 BOXA *boxat, *boxad;
1721 PROCNAME(
"boxaaFlattenAligned");
1724 return (
BOXA *)ERROR_PTR(
"baa not defined", procName, NULL);
1726 return (
BOXA *)ERROR_PTR(
"invalid copyflag", procName, NULL);
1730 for (i = 0; i < n; i++) {
1733 mval = L_MIN(m, num);
1734 nshort = num - mval;
1735 for (j = 0; j < mval; j++) {
1739 for (j = 0; j < nshort; j++) {
1774 l_int32 i, j, n, nbaa, index;
1779 PROCNAME(
"boxaEncapsulateAligned");
1782 return (
BOXAA *)ERROR_PTR(
"boxa not defined", procName, NULL);
1784 return (
BOXAA *)ERROR_PTR(
"invalid copyflag", procName, NULL);
1788 if (num * nbaa != n)
1789 L_ERROR(
"inconsistent alignment: num doesn't divide n\n", procName);
1791 for (i = 0, index = 0; i < nbaa; i++) {
1793 for (j = 0; j < num; j++, index++) {
1826 l_int32 i, j, ny, nb, nbox;
1831 PROCNAME(
"boxaaTranspose");
1834 return (
BOXAA *)ERROR_PTR(
"baas not defined", procName, NULL);
1836 return (
BOXAA *)ERROR_PTR(
"baas empty", procName, NULL);
1839 for (i = 0; i < ny; i++) {
1841 return (
BOXAA *)ERROR_PTR(
"baas is missing a boxa", procName, NULL);
1846 else if (nb != nbox)
1847 return (
BOXAA *)ERROR_PTR(
"boxa are not all the same size",
1853 for (i = 0; i < nbox; i++) {
1855 for (j = 0; j < ny; j++) {
1888 l_int32 i, n, m, y, yt, h, ht, ovlp, maxovlp, maxindex;
1892 PROCNAME(
"boxaaAlignBox");
1894 if (pindex) *pindex = 0;
1896 return ERROR_INT(
"baa not defined", procName, 1);
1898 return ERROR_INT(
"box not defined", procName, 1);
1900 return ERROR_INT(
"&index not defined", procName, 1);
1904 maxovlp = -10000000;
1905 for (i = 0; i < n; i++) {
1909 L_WARNING(
"no boxes in boxa\n", procName);
1919 ovlp = y + h - 1 - yt;
1921 ovlp = yt + ht - 1 - y;
1922 if (ovlp > maxovlp) {
1928 if (maxovlp + delta >= 0)
l_int32 boxaGetValidCount(BOXA *boxa)
boxaGetValidCount()
l_ok boxaaReplaceBoxa(BOXAA *baa, l_int32 index, BOXA *boxa)
boxaaReplaceBoxa()
l_ok boxaIsFull(BOXA *boxa, l_int32 *pfull)
boxaIsFull()
BOXA * boxaCopy(BOXA *boxa, l_int32 copyflag)
boxaCopy()
void boxDestroy(BOX **pbox)
boxDestroy()
BOX * boxaaGetBox(BOXAA *baa, l_int32 iboxa, l_int32 ibox, l_int32 accessflag)
boxaaGetBox()
BOXAA * boxaaCreate(l_int32 n)
boxaaCreate()
l_int32 boxaaGetCount(BOXAA *baa)
boxaaGetCount()
l_ok boxaGetBoxGeometry(BOXA *boxa, l_int32 index, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxaGetBoxGeometry()
l_int32 boxaGetCount(BOXA *boxa)
boxaGetCount()
l_ok boxaaAddBoxa(BOXAA *baa, BOXA *ba, l_int32 copyflag)
boxaaAddBoxa()
l_ok boxGetGeometry(BOX *box, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
boxGetGeometry()
l_ok boxaAddBox(BOXA *boxa, BOX *box, l_int32 copyflag)
boxaAddBox()
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
BOXA * boxaaGetBoxa(BOXAA *baa, l_int32 index, l_int32 accessflag)
boxaaGetBoxa()
BOX * boxaGetBox(BOXA *boxa, l_int32 index, l_int32 accessflag)
boxaGetBox()
BOX * boxCopy(BOX *box)
boxCopy()
void boxaaDestroy(BOXAA **pbaa)
boxaaDestroy()
BOX * boxCreate(l_int32 x, l_int32 y, l_int32 w, l_int32 h)
boxCreate()
BOXA * boxaCreate(l_int32 n)
boxaCreate()
l_ok boxaaAddBox(BOXAA *baa, l_int32 index, BOX *box, l_int32 accessflag)
boxaaAddBox()
l_ok boxaJoin(BOXA *boxad, BOXA *boxas, l_int32 istart, l_int32 iend)
boxaJoin()
BOXA * boxaHandleOverlaps(BOXA *boxas, l_int32 op, l_int32 range, l_float32 min_overlap, l_float32 max_ratio, NUMA **pnamap)
boxaHandleOverlaps()
BOXAA * boxaEncapsulateAligned(BOXA *boxa, l_int32 num, l_int32 copyflag)
boxaEncapsulateAligned()
BOXA * boxaaFlattenAligned(BOXAA *baa, l_int32 num, BOX *fillerbox, l_int32 copyflag)
boxaaFlattenAligned()
BOXAA * boxaSort2dByIndex(BOXA *boxas, NUMAA *naa)
boxaSort2dByIndex()
l_ok boxaaAlignBox(BOXAA *baa, BOX *box, l_int32 delta, l_int32 *pindex)
boxaaAlignBox()
l_ok boxaGetRankVals(BOXA *boxa, l_float32 fract, l_int32 *px, l_int32 *py, l_int32 *pr, l_int32 *pb, l_int32 *pw, l_int32 *ph)
boxaGetRankVals()
PTA * boxaExtractCorners(BOXA *boxa, l_int32 loc)
boxaExtractCorners()
l_ok boxaaGetExtent(BOXAA *baa, l_int32 *pw, l_int32 *ph, BOX **pbox, BOXA **pboxa)
boxaaGetExtent()
BOX * boxRotateOrth(BOX *box, l_int32 w, l_int32 h, l_int32 rotation)
boxRotateOrth()
BOXA * boxaRotateOrth(BOXA *boxas, l_int32 w, l_int32 h, l_int32 rotation)
boxaRotateOrth()
BOX * boxTransformOrdered(BOX *boxs, l_int32 shiftx, l_int32 shifty, l_float32 scalex, l_float32 scaley, l_int32 xcen, l_int32 ycen, l_float32 angle, l_int32 order)
boxTransformOrdered()
BOX * boxTransform(BOX *box, l_int32 shiftx, l_int32 shifty, l_float32 scalex, l_float32 scaley)
boxTransform()
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 boxaGetAverageSize(BOXA *boxa, l_float32 *pw, l_float32 *ph)
boxaGetAverageSize()
BOXA * boxaTransformOrdered(BOXA *boxas, l_int32 shiftx, l_int32 shifty, l_float32 scalex, l_float32 scaley, l_int32 xcen, l_int32 ycen, l_float32 angle, l_int32 order)
boxaTransformOrdered()
BOXA * boxaTransform(BOXA *boxas, l_int32 shiftx, l_int32 shifty, l_float32 scalex, l_float32 scaley)
boxaTransform()
BOXA * boxaaFlattenToBoxa(BOXAA *baa, NUMA **pnaindex, l_int32 copyflag)
boxaaFlattenToBoxa()
BOXA * boxaSort(BOXA *boxas, l_int32 sorttype, l_int32 sortorder, NUMA **pnaindex)
boxaSort()
BOXA * boxaSortByIndex(BOXA *boxas, NUMA *naindex)
boxaSortByIndex()
BOXA * boxaBinSort(BOXA *boxas, l_int32 sorttype, l_int32 sortorder, NUMA **pnaindex)
boxaBinSort()
BOXA * boxaShiftWithPta(BOXA *boxas, PTA *pta, l_int32 dir)
boxaShiftWithPta()
BOXAA * boxaaTranspose(BOXAA *baas)
boxaaTranspose()
l_ok boxaExtractAsPta(BOXA *boxa, PTA **pptal, PTA **pptat, PTA **pptar, PTA **pptab, PTA **pptaw, PTA **pptah, l_int32 keepinvalid)
boxaExtractAsPta()
BOXAA * boxaSort2d(BOXA *boxas, NUMAA **pnaad, l_int32 delta1, l_int32 delta2, l_int32 minh1)
boxaSort2d()
l_ok boxaExtractAsNuma(BOXA *boxa, NUMA **pnal, NUMA **pnat, NUMA **pnar, NUMA **pnab, NUMA **pnaw, NUMA **pnah, l_int32 keepinvalid)
boxaExtractAsNuma()
l_ok boxaGetExtent(BOXA *boxa, l_int32 *pw, l_int32 *ph, BOX **pbox)
boxaGetExtent()
l_ok numaAddNumber(NUMA *na, l_float32 val)
numaAddNumber()
l_int32 numaaGetNumberCount(NUMAA *naa)
numaaGetNumberCount()
NUMA * numaCreate(l_int32 n)
numaCreate()
l_int32 numaaGetCount(NUMAA *naa)
numaaGetCount()
l_ok numaaAddNumber(NUMAA *naa, l_int32 index, l_float32 val)
numaaAddNumber()
NUMA * numaaGetNuma(NUMAA *naa, l_int32 index, l_int32 accessflag)
numaaGetNuma()
void numaDestroy(NUMA **pna)
numaDestroy()
NUMAA * numaaCreate(l_int32 n)
numaaCreate()
l_int32 numaGetCount(NUMA *na)
numaGetCount()
l_ok numaGetIValue(NUMA *na, l_int32 index, l_int32 *pival)
numaGetIValue()
l_ok numaaAddNuma(NUMAA *naa, NUMA *na, l_int32 copyflag)
numaaAddNuma()
void numaaDestroy(NUMAA **pnaa)
numaaDestroy()
l_ok numaaReplaceNuma(NUMAA *naa, l_int32 index, NUMA *na)
numaaReplaceNuma()
NUMA * numaGetSortIndex(NUMA *na, l_int32 sortorder)
numaGetSortIndex()
l_ok numaJoin(NUMA *nad, NUMA *nas, l_int32 istart, l_int32 iend)
numaJoin()
l_ok numaGetRankValue(NUMA *na, l_float32 fract, NUMA *nasort, l_int32 usebins, l_float32 *pval)
numaGetRankValue()
NUMA * numaSortByIndex(NUMA *nas, NUMA *naindex)
numaSortByIndex()
NUMA * numaGetBinSortIndex(NUMA *nas, l_int32 sortorder)
numaGetBinSortIndex()
@ L_SORT_BY_MIN_DIMENSION
@ L_SORT_BY_MAX_DIMENSION
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()
l_int32 ptaGetCount(PTA *pta)
ptaGetCount()
PTA * ptaCreate(l_int32 n)
ptaCreate()