42 #include <config_auto.h> 45 #include "allheaders.h" 74 PIX *pixr, *pixg, *pixb, *pixrm, *pixgm, *pixbm, *pixd;
76 PROCNAME(
"pixColorMorph");
79 return (
PIX *)ERROR_PTR(
"pixs not defined", procName, NULL);
80 if (pixGetDepth(
pixs) != 32)
81 return (
PIX *)ERROR_PTR(
"pixs not 32 bpp", procName, NULL);
82 if (type != L_MORPH_DILATE && type != L_MORPH_ERODE &&
83 type != L_MORPH_OPEN && type != L_MORPH_CLOSE)
84 return (
PIX *)ERROR_PTR(
"invalid morph type", procName, NULL);
85 if (hsize < 1 || vsize < 1)
86 return (
PIX *)ERROR_PTR(
"hsize or vsize < 1", procName, NULL);
87 if ((hsize & 1) == 0 ) {
88 L_WARNING(
"horiz sel size must be odd; increasing by 1\n", procName);
91 if ((vsize & 1) == 0 ) {
92 L_WARNING(
"vert sel size must be odd; increasing by 1\n", procName);
96 if (hsize == 1 && vsize == 1)
102 if (type == L_MORPH_DILATE) {
106 }
else if (type == L_MORPH_ERODE) {
110 }
else if (type == L_MORPH_OPEN) {
PIX * pixDilateGray(PIX *pixs, l_int32 hsize, l_int32 vsize)
pixDilateGray()
PIX * pixCloseGray(PIX *pixs, l_int32 hsize, l_int32 vsize)
pixCloseGray()
PIX * pixCopy(PIX *pixd, const PIX *pixs)
pixCopy()
PIX * pixGetRGBComponent(PIX *pixs, l_int32 comp)
pixGetRGBComponent()
PIX * pixCreateRGBImage(PIX *pixr, PIX *pixg, PIX *pixb)
pixCreateRGBImage()
void pixDestroy(PIX **ppix)
pixDestroy()
PIX * pixOpenGray(PIX *pixs, l_int32 hsize, l_int32 vsize)
pixOpenGray()
PIX * pixErodeGray(PIX *pixs, l_int32 hsize, l_int32 vsize)
pixErodeGray()
PIX * pixColorMorph(PIX *pixs, l_int32 type, l_int32 hsize, l_int32 vsize)
pixColorMorph()