23 #include <fvfilters/sharpen.h> 25 #include <core/exception.h> 29 #elif defined(HAVE_OPENCV) 31 # include <opencv2/imgproc.hpp> 33 # error "Neither IPP nor OpenCV available" 68 if ( status != ippStsNoErr ) {
71 #elif defined(HAVE_OPENCV) 76 cv::Mat srcm(src_roi[0]->height, src_roi[0]->width, CV_8UC1,
78 (src_roi[0]->start.y * src_roi[0]->line_step) +
79 (src_roi[0]->start.x * src_roi[0]->pixel_step),
80 src_roi[0]->line_step);
88 cv::Mat kernel(3, 3, CV_32F);
89 float *kernel_f = (
float *)kernel.ptr();
90 kernel_f[0] = -0.125; kernel_f[1] = -0.125; kernel_f[2] = -0.125;
91 kernel_f[3] = -0.125; kernel_f[4] = 2.0; kernel_f[5] = -0.125;
92 kernel_f[6] = -0.125; kernel_f[7] = -0.125; kernel_f[8] = -0.125;
94 cv::Point kanchor(1, 1);
96 cv::filter2D(srcm, dstm, -1, kernel, kanchor);
fawkes::point_t start
ROI start.
FilterSharpen()
Constructor.
unsigned int x
x coordinate
unsigned int width
ROI width.
virtual void apply()
Apply the filter.
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.