18 #ifndef PIC_FILTERING_FILTER_LAPLACIAN_HPP 19 #define PIC_FILTERING_FILTER_LAPLACIAN_HPP 21 #include "../filtering/filter.hpp" 40 int channels = src[0]->channels;
44 for(
int j = box->
y0; j < box->y1; j++) {
46 for(
int i = box->
x0; i < box->x1; i++) {
48 float *cur = (*in)(i, j);
49 float *out = (*dst)(i, j);
52 float *N = (*in)(i , j + 1);
53 float *S = (*in)(i , j - 1);
54 float *E = (*in)(i + 1, j);
55 float *W = (*in)(i - 1, j);
57 for(
int k = 0; k < channels; k++) {
58 out[k] = (-4.0f * cur[k]) + N[k] + S[k] + E[k] + W[k];
The BBox class manages the creation of bounding boxes for images.
Definition: bbox.hpp:29
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
int x0
Definition: bbox.hpp:32
The FilterLaplacian class.
Definition: filter_laplacian.hpp:28
The Filter class.
Definition: filter.hpp:50
FilterLaplacian()
FilterLaplacian.
Definition: filter_laplacian.hpp:68
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
static Image * execute(Image *imgIn, Image *imgOut)
execute
Definition: filter_laplacian.hpp:79
void ProcessBBox(Image *dst, ImageVec src, BBox *box)
ProcessBBox.
Definition: filter_laplacian.hpp:38
int y0
Definition: bbox.hpp:32
The Image class stores an image as buffer of float.
Definition: image.hpp:60
PIC_INLINE ImageVec Single(Image *img)
Single creates an std::vector which contains img; this is for filters input.
Definition: image_vec.hpp:36
Definition: bilateral_separation.hpp:25