23 #include <fvfilters/hipass.h>
24 #include <core/exception.h>
28 #elif defined(HAVE_OPENCV)
31 # error "Neither IPP nor OpenCV available"
34 namespace firevision {
44 FilterHipass::FilterHipass()
63 size, ippMskSize3x3 );
65 if ( status != ippStsNoErr ) {
69 #elif defined(HAVE_OPENCV)
70 cv::Mat srcm(src_roi[0]->height, src_roi[0]->width, CV_8UC1,
72 (src_roi[0]->start.y * src_roi[0]->line_step) +
73 (src_roi[0]->start.x * src_roi[0]->pixel_step),
74 src_roi[0]->line_step);
84 cv::Mat kernel(3, 3, CV_32F);
85 float *kernel_f = (
float *)kernel.ptr();
86 kernel_f[0] = -1; kernel_f[1] = -1; kernel_f[2] = -1;
87 kernel_f[3] = -1; kernel_f[4] = 8; kernel_f[5] = -1;
88 kernel_f[6] = -1; kernel_f[7] = -1; kernel_f[8] = -1;
90 cv::Point kanchor(1, 1);
92 cv::filter2D(srcm, dstm, -1, kernel, kanchor);
virtual void apply()
Apply the filter.
fawkes::point_t start
ROI start.
unsigned int x
x coordinate
unsigned int width
ROI width.
unsigned char ** src
Source buffers, dynamically allocated by Filter ctor.
Base class for exceptions in Fawkes.
unsigned int y
y coordinate
ROI ** src_roi
Source ROIs, dynamically allocated by Filter ctor.
unsigned int height
ROI height.
unsigned int line_step
line step
unsigned char * dst
Destination buffer.
unsigned int pixel_step
pixel step
ROI * dst_roi
Destination ROI.