Leptonica  1.77.0
Image processing and image analysis suite
pixlabel.c
Go to the documentation of this file.
1 /*====================================================================*
2  - Copyright (C) 2001 Leptonica. All rights reserved.
3  -
4  - Redistribution and use in source and binary forms, with or without
5  - modification, are permitted provided that the following conditions
6  - are met:
7  - 1. Redistributions of source code must retain the above copyright
8  - notice, this list of conditions and the following disclaimer.
9  - 2. Redistributions in binary form must reproduce the above
10  - copyright notice, this list of conditions and the following
11  - disclaimer in the documentation and/or other materials
12  - provided with the distribution.
13  -
14  - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15  - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16  - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17  - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY
18  - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19  - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20  - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21  - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22  - OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23  - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24  - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  *====================================================================*/
26 
82 #include <string.h>
83 #include <math.h>
84 #include "allheaders.h"
85 
86 
87 
88 /*-----------------------------------------------------------------------*
89  * Label pixels by an index for connected component membership *
90  *-----------------------------------------------------------------------*/
113 PIX *
115  l_int32 connect,
116  l_int32 depth)
117 {
118 l_int32 i, n, index, w, h, xb, yb, wb, hb;
119 BOXA *boxa;
120 PIX *pix1, *pix2, *pixd;
121 PIXA *pixa;
122 
123  PROCNAME("pixConnCompTransform");
124 
125  if (!pixs || pixGetDepth(pixs) != 1)
126  return (PIX *)ERROR_PTR("pixs undefined or not 1 bpp", procName, NULL);
127  if (connect != 4 && connect != 8)
128  return (PIX *)ERROR_PTR("connectivity must be 4 or 8", procName, NULL);
129  if (depth != 0 && depth != 8 && depth != 16 && depth != 32)
130  return (PIX *)ERROR_PTR("depth must be 0, 8, 16 or 32", procName, NULL);
131 
132  boxa = pixConnComp(pixs, &pixa, connect);
133  n = pixaGetCount(pixa);
134  boxaDestroy(&boxa);
135  pixGetDimensions(pixs, &w, &h, NULL);
136  if (depth == 0) {
137  if (n < 254)
138  depth = 8;
139  else if (n < 0xfffe)
140  depth = 16;
141  else
142  depth = 32;
143  }
144  pixd = pixCreate(w, h, depth);
145  pixSetSpp(pixd, 1);
146  if (n == 0) { /* no fg */
147  pixaDestroy(&pixa);
148  return pixd;
149  }
150 
151  /* Label each component and blit it in */
152  for (i = 0; i < n; i++) {
153  pixaGetBoxGeometry(pixa, i, &xb, &yb, &wb, &hb);
154  pix1 = pixaGetPix(pixa, i, L_CLONE);
155  if (depth == 8) {
156  index = 1 + (i % 254);
157  pix2 = pixConvert1To8(NULL, pix1, 0, index);
158  } else if (depth == 16) {
159  index = 1 + (i % 0xfffe);
160  pix2 = pixConvert1To16(NULL, pix1, 0, index);
161  } else { /* depth == 32 */
162  index = 1 + i;
163  pix2 = pixConvert1To32(NULL, pix1, 0, index);
164  }
165  pixRasterop(pixd, xb, yb, wb, hb, PIX_PAINT, pix2, 0, 0);
166  pixDestroy(&pix1);
167  pixDestroy(&pix2);
168  }
169 
170  pixaDestroy(&pixa);
171  return pixd;
172 }
173 
174 
175 /*-----------------------------------------------------------------------*
176  * Label pixels by the area of their connected component *
177  *-----------------------------------------------------------------------*/
193 PIX *
195  l_int32 connect)
196 {
197 l_int32 i, n, npix, w, h, xb, yb, wb, hb;
198 l_int32 *tab8;
199 BOXA *boxa;
200 PIX *pix1, *pix2, *pixd;
201 PIXA *pixa;
202 
203  PROCNAME("pixConnCompAreaTransform");
204 
205  if (!pixs || pixGetDepth(pixs) != 1)
206  return (PIX *)ERROR_PTR("pixs undefined or not 1 bpp", procName, NULL);
207  if (connect != 4 && connect != 8)
208  return (PIX *)ERROR_PTR("connectivity must be 4 or 8", procName, NULL);
209 
210  boxa = pixConnComp(pixs, &pixa, connect);
211  n = pixaGetCount(pixa);
212  boxaDestroy(&boxa);
213  pixGetDimensions(pixs, &w, &h, NULL);
214  pixd = pixCreate(w, h, 32);
215  pixSetSpp(pixd, 1);
216  if (n == 0) { /* no fg */
217  pixaDestroy(&pixa);
218  return pixd;
219  }
220 
221  /* Label each component and blit it in */
222  tab8 = makePixelSumTab8();
223  for (i = 0; i < n; i++) {
224  pixaGetBoxGeometry(pixa, i, &xb, &yb, &wb, &hb);
225  pix1 = pixaGetPix(pixa, i, L_CLONE);
226  pixCountPixels(pix1, &npix, tab8);
227  pix2 = pixConvert1To32(NULL, pix1, 0, npix);
228  pixRasterop(pixd, xb, yb, wb, hb, PIX_PAINT, pix2, 0, 0);
229  pixDestroy(&pix1);
230  pixDestroy(&pix2);
231  }
232 
233  pixaDestroy(&pixa);
234  LEPT_FREE(tab8);
235  return pixd;
236 }
237 
238 
239 /*-------------------------------------------------------------------------*
240  * Label pixels to allow incremental computation of connected components *
241  *-------------------------------------------------------------------------*/
266 l_ok
268  l_int32 conn,
269  PIX **ppixd,
270  PTAA **pptaa,
271  l_int32 *pncc)
272 {
273 l_int32 empty, w, h, ncc;
274 PIX *pixd;
275 PTA *pta;
276 PTAA *ptaa;
277 
278  PROCNAME("pixConnCompIncrInit");
279 
280  if (ppixd) *ppixd = NULL;
281  if (pptaa) *pptaa = NULL;
282  if (pncc) *pncc = 0;
283  if (!ppixd || !pptaa || !pncc)
284  return ERROR_INT("&pixd, &ptaa, &ncc not all defined", procName, 1);
285  if (!pixs || pixGetDepth(pixs) != 1)
286  return ERROR_INT("pixs undefined or not 1 bpp", procName, 1);
287  if (conn != 4 && conn != 8)
288  return ERROR_INT("connectivity must be 4 or 8", procName, 1);
289 
290  pixGetDimensions(pixs, &w, &h, NULL);
291  pixZero(pixs, &empty);
292  if (empty) {
293  *ppixd = pixCreate(w, h, 32);
294  pixSetSpp(*ppixd, 1);
295  pixSetSpecial(*ppixd, conn);
296  *pptaa = ptaaCreate(0);
297  pta = ptaCreate(1);
298  ptaaAddPta(*pptaa, pta, L_INSERT); /* reserve index 0 for background */
299  return 0;
300  }
301 
302  /* Set up the initial labeled image and indexed pixel arrays */
303  if ((pixd = pixConnCompTransform(pixs, conn, 32)) == NULL)
304  return ERROR_INT("pixd not made", procName, 1);
305  pixSetSpecial(pixd, conn);
306  *ppixd = pixd;
307  if ((ptaa = ptaaIndexLabeledPixels(pixd, &ncc)) == NULL)
308  return ERROR_INT("ptaa not made", procName, 1);
309  *pptaa = ptaa;
310  *pncc = ncc;
311  return 0;
312 }
313 
314 
350 l_int32
352  PTAA *ptaa,
353  l_int32 *pncc,
354  l_float32 x,
355  l_float32 y,
356  l_int32 debug)
357 {
358 l_int32 conn, i, j, w, h, count, nvals, ns, firstindex;
359 l_uint32 val;
360 l_int32 *neigh;
361 PTA *ptas, *ptad;
362 
363  PROCNAME("pixConnCompIncrAdd");
364 
365  if (!pixs || pixGetDepth(pixs) != 32)
366  return ERROR_INT("pixs not defined or not 32 bpp", procName, 1);
367  if (!ptaa)
368  return ERROR_INT("ptaa not defined", procName, 1);
369  if (!pncc)
370  return ERROR_INT("&ncc not defined", procName, 1);
371  conn = pixs->special;
372  if (conn != 4 && conn != 8)
373  return ERROR_INT("connectivity must be 4 or 8", procName, 1);
374  pixGetDimensions(pixs, &w, &h, NULL);
375  if (x < 0 || x >= w)
376  return ERROR_INT("invalid x pixel location", procName, 1);
377  if (y < 0 || y >= h)
378  return ERROR_INT("invalid y pixel location", procName, 1);
379 
380  pixGetPixel(pixs, x, y, &val);
381  if (val > 0) /* already belongs to a set */
382  return -1;
383 
384  /* Find unique neighbor pixel values in increasing order of value.
385  * If %nvals > 0, these are returned in the %neigh array, which
386  * is of size %nvals. Note that the pixel values in each
387  * connected component are used as the index into the pta
388  * array of the ptaa, giving the pixel locations. */
389  pixGetSortedNeighborValues(pixs, x, y, conn, &neigh, &nvals);
390 
391  /* If there are no neighbors, just add a new component */
392  if (nvals == 0) {
393  count = ptaaGetCount(ptaa);
394  pixSetPixel(pixs, x, y, count);
395  ptas = ptaCreate(1);
396  ptaAddPt(ptas, x, y);
397  ptaaAddPta(ptaa, ptas, L_INSERT);
398  *pncc += 1;
399  LEPT_FREE(neigh);
400  return 0;
401  }
402 
403  /* Otherwise, there is at least one neighbor. Add the pixel
404  * to the first neighbor c.c. */
405  firstindex = neigh[0];
406  pixSetPixel(pixs, x, y, firstindex);
407  ptaaAddPt(ptaa, neigh[0], x, y);
408  if (nvals == 1) {
409  if (debug == 1)
410  fprintf(stderr, "nvals = %d: neigh = (%d)\n", nvals, neigh[0]);
411  LEPT_FREE(neigh);
412  return 0;
413  }
414 
415  /* If nvals > 1, there are at least 2 neighbors, so this pixel
416  * joins at least one pair of existing c.c. Join each component
417  * to the first component in the list, which is the one with
418  * the smallest integer label. This is done in two steps:
419  * (a) re-label the pixels in the component to the label of the
420  * first component, and
421  * (b) save the pixel locations in the pta for the first component. */
422  if (nvals == 2) {
423  if (debug >= 1 && debug <= 2) {
424  fprintf(stderr, "nvals = %d: neigh = (%d,%d)\n", nvals,
425  neigh[0], neigh[1]);
426  }
427  } else if (nvals == 3) {
428  if (debug >= 1 && debug <= 3) {
429  fprintf(stderr, "nvals = %d: neigh = (%d,%d,%d)\n", nvals,
430  neigh[0], neigh[1], neigh[2]);
431  }
432  } else { /* nvals == 4 */
433  if (debug >= 1 && debug <= 4) {
434  fprintf(stderr, "nvals = %d: neigh = (%d,%d,%d,%d)\n", nvals,
435  neigh[0], neigh[1], neigh[2], neigh[3]);
436  }
437  }
438  ptad = ptaaGetPta(ptaa, firstindex, L_CLONE);
439  for (i = 1; i < nvals; i++) {
440  ptas = ptaaGetPta(ptaa, neigh[i], L_CLONE);
441  ns = ptaGetCount(ptas);
442  for (j = 0; j < ns; j++) { /* relabel pixels */
443  ptaGetPt(ptas, j, &x, &y);
444  pixSetPixel(pixs, x, y, firstindex);
445  }
446  ptaJoin(ptad, ptas, 0, -1); /* add relabeled pixel locations */
447  *pncc -= 1;
448  ptaDestroy(&ptaa->pta[neigh[i]]);
449  ptaDestroy(&ptas); /* the clone */
450  }
451  ptaDestroy(&ptad); /* the clone */
452  LEPT_FREE(neigh);
453  return 0;
454 }
455 
456 
480 l_ok
482  l_int32 x,
483  l_int32 y,
484  l_int32 conn,
485  l_int32 **pneigh,
486  l_int32 *pnvals)
487 {
488 l_int32 i, npt, index;
489 l_int32 neigh[4];
490 l_uint32 val;
491 l_float32 fx, fy;
492 L_ASET *aset;
494 PTA *pta;
495 RB_TYPE key;
496 
497  PROCNAME("pixGetSortedNeighborValues");
498 
499  if (pneigh) *pneigh = NULL;
500  if (pnvals) *pnvals = 0;
501  if (!pneigh || !pnvals)
502  return ERROR_INT("&neigh and &nvals not both defined", procName, 1);
503  if (!pixs || pixGetDepth(pixs) < 8)
504  return ERROR_INT("pixs not defined or depth < 8", procName, 1);
505 
506  /* Identify the locations of nearest neighbor pixels */
507  if ((pta = ptaGetNeighborPixLocs(pixs, x, y, conn)) == NULL)
508  return ERROR_INT("pta of neighbors not made", procName, 1);
509 
510  /* Find the pixel values and insert into a set as keys */
511  aset = l_asetCreate(L_UINT_TYPE);
512  npt = ptaGetCount(pta);
513  for (i = 0; i < npt; i++) {
514  ptaGetPt(pta, i, &fx, &fy);
515  pixGetPixel(pixs, (l_int32)fx, (l_int32)fy, &val);
516  key.utype = val;
517  l_asetInsert(aset, key);
518  }
519 
520  /* Extract the set keys and put them into the %neigh array.
521  * Omit the value 0, which indicates the pixel doesn't
522  * belong to one of the sets of connected components. */
523  node = l_asetGetFirst(aset);
524  index = 0;
525  while (node) {
526  val = node->key.utype;
527  if (val > 0)
528  neigh[index++] = (l_int32)val;
529  node = l_asetGetNext(node);
530  }
531  *pnvals = index;
532  if (index > 0) {
533  *pneigh = (l_int32 *)LEPT_CALLOC(index, sizeof(l_int32));
534  for (i = 0; i < index; i++)
535  (*pneigh)[i] = neigh[i];
536  }
537 
538  ptaDestroy(&pta);
539  l_asetDestroy(&aset);
540  return 0;
541 }
542 
543 
544 /*-----------------------------------------------------------------------*
545  * Label pixels with spatially-dependent color coding *
546  *-----------------------------------------------------------------------*/
566 PIX *
568 {
569 l_int32 w, h, w2, h2, wpls, wplr, wplg, wplb, wplcc, i, j, rval, gval, bval;
570 l_float32 invw2, invh2;
571 l_uint32 *datas, *datar, *datag, *datab, *datacc;
572 l_uint32 *lines, *liner, *lineg, *lineb, *linecc;
573 PIX *pix1, *pixcc, *pixr, *pixg, *pixb, *pixd;
574 
575  PROCNAME("pixLocToColorTransform");
576 
577  if (!pixs || pixGetDepth(pixs) != 1)
578  return (PIX *)ERROR_PTR("pixs undefined or not 1 bpp", procName, NULL);
579 
580  /* Label each pixel with the area of the c.c. to which it belongs.
581  * Clip the result to 255 in an 8 bpp pix. This is used for
582  * the blue component of pixd. */
583  pixGetDimensions(pixs, &w, &h, NULL);
584  w2 = w / 2;
585  h2 = h / 2;
586  invw2 = 255.0 / (l_float32)w2;
587  invh2 = 255.0 / (l_float32)h2;
588  pix1 = pixConnCompAreaTransform(pixs, 8);
590  pixDestroy(&pix1);
591 
592  /* Label the red and green components depending on the location
593  * of the fg pixels, in a way that is 4-fold rotationally invariant. */
594  pixr = pixCreate(w, h, 8);
595  pixg = pixCreate(w, h, 8);
596  pixb = pixCreate(w, h, 8);
597  wpls = pixGetWpl(pixs);
598  wplr = pixGetWpl(pixr);
599  wplg = pixGetWpl(pixg);
600  wplb = pixGetWpl(pixb);
601  wplcc = pixGetWpl(pixcc);
602  datas = pixGetData(pixs);
603  datar = pixGetData(pixr);
604  datag = pixGetData(pixg);
605  datab = pixGetData(pixb);
606  datacc = pixGetData(pixcc);
607  for (i = 0; i < h; i++) {
608  lines = datas + i * wpls;
609  liner = datar + i * wplr;
610  lineg = datag + i * wplg;
611  lineb = datab + i * wplb;
612  linecc = datacc+ i * wplcc;
613  for (j = 0; j < w; j++) {
614  if (GET_DATA_BIT(lines, j) == 0) continue;
615  if (w < h) {
616  rval = invh2 * L_ABS((l_float32)(i - h2));
617  gval = invw2 * L_ABS((l_float32)(j - w2));
618  } else {
619  rval = invw2 * L_ABS((l_float32)(j - w2));
620  gval = invh2 * L_ABS((l_float32)(i - h2));
621  }
622  bval = GET_DATA_BYTE(linecc, j);
623  SET_DATA_BYTE(liner, j, rval);
624  SET_DATA_BYTE(lineg, j, gval);
625  SET_DATA_BYTE(lineb, j, bval);
626  }
627  }
628  pixd = pixCreateRGBImage(pixr, pixg, pixb);
629 
630  pixDestroy(&pixcc);
631  pixDestroy(&pixr);
632  pixDestroy(&pixg);
633  pixDestroy(&pixb);
634  return pixd;
635 }
l_ok pixConnCompIncrInit(PIX *pixs, l_int32 conn, PIX **ppixd, PTAA **pptaa, l_int32 *pncc)
pixConnCompIncrInit()
Definition: pixlabel.c:267
Definition: pix.h:717
PIX * pixLocToColorTransform(PIX *pixs)
pixLocToColorTransform()
Definition: pixlabel.c:567
l_int32 special
Definition: pix.h:147
l_ok ptaaAddPt(PTAA *ptaa, l_int32 ipta, l_float32 x, l_float32 y)
ptaaAddPt()
Definition: ptabasic.c:1235
l_ok ptaAddPt(PTA *pta, l_float32 x, l_float32 y)
ptaAddPt()
Definition: ptabasic.c:342
l_ok pixGetSortedNeighborValues(PIX *pixs, l_int32 x, l_int32 y, l_int32 conn, l_int32 **pneigh, l_int32 *pnvals)
pixGetSortedNeighborValues()
Definition: pixlabel.c:481
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()
Definition: rop.c:193
PTA * ptaCreate(l_int32 n)
ptaCreate()
Definition: ptabasic.c:116
PIX * pixCreate(l_int32 width, l_int32 height, l_int32 depth)
pixCreate()
Definition: pix1.c:302
PIX * pixConnCompAreaTransform(PIX *pixs, l_int32 connect)
pixConnCompAreaTransform()
Definition: pixlabel.c:194
l_int32 ptaGetCount(PTA *pta)
ptaGetCount()
Definition: ptabasic.c:504
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
Definition: boxbasic.c:580
l_uint32 * pixGetData(PIX *pix)
pixGetData()
Definition: pix1.c:1624
#define GET_DATA_BIT(pdata, n)
Definition: arrayaccess.h:123
Definition: pix.h:492
l_ok ptaJoin(PTA *ptad, PTA *ptas, l_int32 istart, l_int32 iend)
ptaJoin()
Definition: ptafunc1.c:164
BOXA * pixConnComp(PIX *pixs, PIXA **ppixa, l_int32 connectivity)
pixConnComp()
Definition: conncomp.c:147
PTA * ptaaGetPta(PTAA *ptaa, l_int32 index, l_int32 accessflag)
ptaaGetPta()
Definition: ptabasic.c:1094
l_int32 pixConnCompIncrAdd(PIX *pixs, PTAA *ptaa, l_int32 *pncc, l_float32 x, l_float32 y, l_int32 debug)
pixConnCompIncrAdd()
Definition: pixlabel.c:351
Definition: pix.h:532
l_ok pixSetPixel(PIX *pix, l_int32 x, l_int32 y, l_uint32 val)
pixSetPixel()
Definition: pix2.c:253
PIX * pixConvert1To32(PIX *pixd, PIX *pixs, l_uint32 val0, l_uint32 val1)
pixConvert1To32()
Definition: pixconv.c:2017
l_ok pixCountPixels(PIX *pixs, l_int32 *pcount, l_int32 *tab8)
pixCountPixels()
Definition: pix3.c:1823
l_ok ptaGetPt(PTA *pta, l_int32 index, l_float32 *px, l_float32 *py)
ptaGetPt()
Definition: ptabasic.c:525
l_int32 * makePixelSumTab8(void)
makePixelSumTab8()
Definition: pix3.c:2297
PTA * ptaGetNeighborPixLocs(PIX *pixs, l_int32 x, l_int32 y, l_int32 conn)
ptaGetNeighborPixLocs()
Definition: ptafunc1.c:2191
#define SET_DATA_BYTE(pdata, n, val)
Definition: arrayaccess.h:198
#define GET_DATA_BYTE(pdata, n)
Definition: arrayaccess.h:188
#define PIX_PAINT
Definition: pix.h:333
l_ok pixaGetBoxGeometry(PIXA *pixa, l_int32 index, l_int32 *px, l_int32 *py, l_int32 *pw, l_int32 *ph)
pixaGetBoxGeometry()
Definition: pixabasic.c:835
PIX * pixCreateRGBImage(PIX *pixr, PIX *pixg, PIX *pixb)
pixCreateRGBImage()
Definition: pix2.c:2348
void pixDestroy(PIX **ppix)
pixDestroy()
Definition: pix1.c:543
Definition: pix.h:454
l_ok pixGetPixel(PIX *pix, l_int32 x, l_int32 y, l_uint32 *pval)
pixGetPixel()
Definition: pix2.c:180
l_ok pixGetDimensions(const PIX *pix, l_int32 *pw, l_int32 *ph, l_int32 *pd)
pixGetDimensions()
Definition: pix1.c:1065
l_int32 ptaaGetCount(PTAA *ptaa)
ptaaGetCount()
Definition: ptabasic.c:1074
PIX * pixaGetPix(PIXA *pixa, l_int32 index, l_int32 accesstype)
pixaGetPix()
Definition: pixabasic.c:672
Definition: pix.h:134
PIX * pixConnCompTransform(PIX *pixs, l_int32 connect, l_int32 depth)
pixConnCompTransform()
Definition: pixlabel.c:114
Definition: pix.h:719
void ptaDestroy(PTA **ppta)
ptaDestroy()
Definition: ptabasic.c:192
l_ok pixZero(PIX *pix, l_int32 *pempty)
pixZero()
Definition: pix3.c:1701
PIX * pixConvert1To8(PIX *pixd, PIX *pixs, l_uint8 val0, l_uint8 val1)
pixConvert1To8()
Definition: pixconv.c:2366
PTAA * ptaaIndexLabeledPixels(PIX *pixs, l_int32 *pncc)
ptaaIndexLabeledPixels()
Definition: ptafunc1.c:2134
Definition: rbtree.h:61
PIX * pixConvert1To16(PIX *pixd, PIX *pixs, l_uint16 val0, l_uint16 val1)
pixConvert1To16()
Definition: pixconv.c:1943
l_ok ptaaAddPta(PTAA *ptaa, PTA *pta, l_int32 copyflag)
ptaaAddPta()
Definition: ptabasic.c:1004
void pixaDestroy(PIXA **ppixa)
pixaDestroy()
Definition: pixabasic.c:408
l_int32 pixaGetCount(PIXA *pixa)
pixaGetCount()
Definition: pixabasic.c:631
PTAA * ptaaCreate(l_int32 n)
ptaaCreate()
Definition: ptabasic.c:939
Definition: pix.h:517
PIX * pixConvert32To8(PIX *pixs, l_int32 type16, l_int32 type8)
pixConvert32To8()
Definition: pixconv.c:3623
struct Pta ** pta
Definition: pix.h:536