23 #include <fvfilters/sharpen.h> 25 #include <core/exception.h> 29 #elif defined(HAVE_OPENCV) 30 # if CV_MAJOR_VERSION < 2 || (CV_MAJOR_VERSION == 2 && CV_MINOR_VERSION < 4) 31 # include <opencv/cv.h> 33 # include <opencv/cv.hpp> 35 # error "Neither IPP nor OpenCV available" 70 if ( status != ippStsNoErr ) {
73 #elif defined(HAVE_OPENCV) 78 cv::Mat srcm(src_roi[0]->height, src_roi[0]->width, CV_8UC1,
80 (src_roi[0]->start.y * src_roi[0]->line_step) +
81 (src_roi[0]->start.x * src_roi[0]->pixel_step),
82 src_roi[0]->line_step);
90 cv::Mat kernel(3, 3, CV_32F);
91 float *kernel_f = (
float *)kernel.ptr();
92 kernel_f[0] = -0.125; kernel_f[1] = -0.125; kernel_f[2] = -0.125;
93 kernel_f[3] = -0.125; kernel_f[4] = 2.0; kernel_f[5] = -0.125;
94 kernel_f[6] = -0.125; kernel_f[7] = -0.125; kernel_f[8] = -0.125;
96 cv::Point kanchor(1, 1);
98 cv::filter2D(srcm, dstm, -1, kernel, kanchor);
FilterSharpen()
Constructor.
fawkes::upoint_t start
ROI start.
unsigned int y
y coordinate
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.
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.