24 #include <core/exception.h>
26 #include <fvfilters/morphology/geodesic_dilation.h>
27 #include <fvfilters/morphology/segenerator.h>
28 #include <fvfilters/morphology/dilation.h>
29 #include <fvfilters/min.h>
31 #include <fvutils/statistical/imagediff.h>
32 #include <fvutils/color/colorspaces.h>
33 #include <fvutils/base/roi.h>
38 namespace firevision {
44 const unsigned int FilterGeodesicDilation::MARKER = 0;
46 const unsigned int FilterGeodesicDilation::MASK = 1;
49 fawkes::Exception e("FilterGeodesicDilation failed"); \
50 e.append("Function: %s", __FUNCTION__); \
51 e.append("Message: %s", m); \
64 FilterGeodesicDilation::FilterGeodesicDilation(
unsigned int se_size)
67 this->se_size = (se_size > 0) ? se_size : 1;
96 if (
dst == NULL ) ERROR(
"dst == NULL");
97 if (
src[
MASK] == NULL ) ERROR(
"src[MASK] == NULL");
98 if (
src[
MARKER] == NULL ) ERROR(
"src[MARKER] == NULL");
101 unsigned char *tmp = (
unsigned char *)malloc(colorspace_buffer_size(YUV422_PLANAR,
src_roi[MARKER]->image_width,
src_roi[MARKER]->image_height) );
102 memcpy( tmp,
src[MARKER], colorspace_buffer_size(YUV422_PLANAR,
src_roi[MARKER]->image_width,
src_roi[MARKER]->image_height) );
119 }
while (diff->
different() && ( ++iterations < 255) );