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); \
62 this->se_size = (se_size > 0) ? se_size : 1;
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
virtual void apply()
Apply the filter.
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.
Morphological filter interface.
Image difference checker.
virtual void set_structuring_element(unsigned char *se, unsigned int se_width, unsigned int se_height, unsigned int se_anchor_x, unsigned int se_anchor_y)
Set the structuring element for successive filter runs.
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.
virtual void apply()
Apply the filter.
virtual void apply()
Apply the filter.