72 #include <config_auto.h> 75 #include "allheaders.h" 78 static SELA *makeCheckerboardCornerSela(l_int32 size, l_int32 dilation,
79 l_int32 nsels,
PIXA *pixadb);
80 static PIXA *makeCheckerboardCornerPixa(l_int32 size, l_int32 dilation,
83 static const char selnames[64] =
"s_diag1 s_diag2 s_cross1 s_cross2";
110 pixFindCheckerboardCorners(
PIX *pixs,
119 PIX *pix1, *pix2, *pix3;
124 PROCNAME(
"pixFindCheckerboardCorners");
126 if (ppix_corners) *ppix_corners = NULL;
127 if (ppta_corners) *ppta_corners = NULL;
129 return ERROR_INT(
"pixs not defined", procName, 1);
130 if (size <= 0) size = 7;
132 return ERROR_INT(
"size too small", procName, 1);
133 if (dilation < 1 || dilation > 5)
134 return ERROR_INT(
"dilation not in [1 ...5]", procName, 1);
135 if (nsels != 2 && nsels != 4)
136 return ERROR_INT(
"nsels not 2 or 4", procName, 1);
139 sela = makeCheckerboardCornerSela(size, dilation, nsels, pixadb);
141 return ERROR_INT(
"sela not made", procName, 1);
175 *ppix_corners = pix3;
179 *ppta_corners = pta1;
201 makeCheckerboardCornerSela(l_int32 size,
211 PROCNAME(
"makeCheckerboardCornerSela");
213 if (size <= 0) size = 7;
215 return (
SELA *)ERROR_PTR(
"size too small", procName, NULL);
216 if (dilation < 1 || dilation > 5)
217 return (
SELA *)ERROR_PTR(
"dilation not in [1 ...5]", procName, NULL);
218 if (nsels != 2 && nsels != 4)
219 return (
SELA *)ERROR_PTR(
"nsels not 2 or 4", procName, NULL);
221 if ((pixa1 = makeCheckerboardCornerPixa(size, dilation, nsels)) == NULL)
222 return (
SELA *)ERROR_PTR(
"pixa for sels not made", procName, NULL);
232 return (
SELA *)ERROR_PTR(
"sela not made", procName, NULL);
254 makeCheckerboardCornerPixa(l_int32 size,
258 PIX *pix1, *pix2, *pix3;
l_ok pixSetRGBPixel(PIX *pix, l_int32 x, l_int32 y, l_int32 rval, l_int32 gval, l_int32 bval)
pixSetRGBPixel()
SELA * selaCreateFromColorPixa(PIXA *pixa, SARRAY *sa)
l_ok pixSetMasked(PIX *pixd, PIX *pixm, l_uint32 val)
pixSetMasked()
PIXA * pixaCreate(l_int32 n)
pixaCreate()
PIX * pixUnionOfMorphOps(PIX *pixs, SELA *sela, l_int32 type)
pixUnionOfMorphOps()
PIX * pixDilateBrick(PIX *pixd, PIX *pixs, l_int32 hsize, l_int32 vsize)
pixDilateBrick()
PIX * pixCreate(l_int32 width, l_int32 height, l_int32 depth)
pixCreate()
PIX * pixSelectBySize(PIX *pixs, l_int32 width, l_int32 height, l_int32 connectivity, l_int32 type, l_int32 relation, l_int32 *pchanged)
pixSelectBySize()
l_ok pixSetAll(PIX *pix)
pixSetAll()
void boxaDestroy(BOXA **pboxa)
boxaDestroy()
PIX * pixaDisplayTiledInColumns(PIXA *pixas, l_int32 nx, l_float32 scalefactor, l_int32 spacing, l_int32 border)
pixaDisplayTiledInColumns()
void selaDestroy(SELA **psela)
selaDestroy()
PIX * pixThinConnected(PIX *pixs, l_int32 type, l_int32 connectivity, l_int32 maxiters)
pixThinConnected()
l_ok pixaAddPix(PIXA *pixa, PIX *pix, l_int32 copyflag)
pixaAddPix()
void selDestroy(SEL **psel)
selDestroy()
BOXA * pixConnCompBB(PIX *pixs, l_int32 connectivity)
pixConnCompBB()
l_ok pixSetPixel(PIX *pix, l_int32 x, l_int32 y, l_uint32 val)
pixSetPixel()
void pixDestroy(PIX **ppix)
pixDestroy()
PIX * pixDisplaySelectedPixels(PIX *pixs, PIX *pixm, SEL *sel, l_uint32 val)
pixDisplaySelectedPixels()
PTA * boxaExtractCorners(BOXA *boxa, l_int32 loc)
boxaExtractCorners()
SEL * selMakePlusSign(l_int32 size, l_int32 linewidth)
selMakePlusSign()
void ptaDestroy(PTA **ppta)
ptaDestroy()
PIX * pixRotate90(PIX *pixs, l_int32 direction)
pixRotate90()
void pixaDestroy(PIXA **ppixa)
pixaDestroy()
PIX * selaDisplayInPix(SELA *sela, l_int32 size, l_int32 gthick, l_int32 spacing, l_int32 ncols)
selaDisplayInPix()
SARRAY * sarrayCreateWordsFromString(const char *string)
sarrayCreateWordsFromString()
void sarrayDestroy(SARRAY **psa)
sarrayDestroy()