Fawkes API
Fawkes Development Version
|
24 #include <core/exception.h>
25 #include <fvfilters/min.h>
26 #include <fvfilters/morphology/dilation.h>
27 #include <fvfilters/morphology/geodesic_dilation.h>
28 #include <fvfilters/morphology/segenerator.h>
29 #include <fvutils/base/roi.h>
30 #include <fvutils/color/colorspaces.h>
31 #include <fvutils/statistical/imagediff.h>
36 namespace firevision {
45 fawkes::Exception e("FilterGeodesicDilation failed"); \
46 e.append("Function: %s", __FUNCTION__); \
47 e.append("Message: %s", m); \
60 : MorphologicalFilter(
"Morphological Geodesic Dilation", 2)
62 this->se_size = (se_size > 0) ? se_size : 1;
71 dilate->set_structuring_element(isotropic_se, se_size, se_size, se_size / 2, se_size / 2);
92 ERROR(
"src[MASK] == NULL");
94 ERROR(
"src[MARKER] == NULL");
96 ERROR(
"marker and mask ROI differ");
99 (
unsigned char *)malloc(colorspace_buffer_size(YUV422_PLANAR,
104 colorspace_buffer_size(YUV422_PLANAR,
124 }
while (diff->
different() && (++iterations < 255));
virtual void set_src_buffer(unsigned char *buf, ROI *roi, orientation_t ori=ORI_HORIZONTAL, unsigned int buffer_num=0)
Set source buffer with orientation.
unsigned char ** src
Source buffers, dynamically allocated by Filter ctor.
unsigned int image_width
width of image that contains this ROI
unsigned int image_height
height of image that contains this ROI
static const unsigned int MASK
Mask.
void setBufferB(unsigned char *yuv422planar_buffer, unsigned int width, unsigned int height)
Set second buffer.
virtual ~FilterGeodesicDilation()
Destructor.
virtual void set_dst_buffer(unsigned char *buf, ROI *roi)
Set the destination buffer.
ROI ** src_roi
Source ROIs, dynamically allocated by Filter ctor.
void setBufferA(unsigned char *yuv422planar_buffer, unsigned int width, unsigned int height)
Set first buffer.
virtual unsigned int num_iterations()
Get the number of iterations.
FilterGeodesicDilation(unsigned int se_size=3)
Constructor.
ROI * dst_roi
Destination ROI.
static const unsigned int MARKER
Marker.
bool different()
Check if images are different.
static unsigned char * square(unsigned int width, unsigned int height)
Generate square structuring element.
unsigned char * dst
Destination buffer.