18 #ifndef PIC_FILTERING_FILTER_CONV_2D_HPP 19 #define PIC_FILTERING_FILTER_CONV_2D_HPP 21 #include "../util/array.hpp" 23 #include "../filtering/filter.hpp" 47 int c_w_h = (conv->
width >> 1);
48 int c_h_h = (conv->
height >> 1);
50 for(
int j = box->
y0; j < box->y1; j++) {
51 for(
int i = box->
x0; i < box->x1; i++) {
52 float *dst_data = (*dst)(i, j);
56 for(
int k = -c_h_h; k <= c_h_h; k++) {
57 for(
int l = -c_w_h; l <= c_w_h; l++) {
59 float *img_data = (*img)(i + l, j + k);
60 float *conv_data = (*conv)(l + c_w_h, k + c_h_h);
62 for(
int c = 0; c < channels; c++) {
64 dst_data[c] += img_data[c] * conv_data[c2];
The BBox class manages the creation of bounding boxes for images.
Definition: bbox.hpp:29
int channels
Definition: image.hpp:80
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
FilterConv2D()
FilterConv2D.
Definition: filter_conv_2d.hpp:77
int x0
Definition: bbox.hpp:32
The Filter class.
Definition: filter.hpp:50
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
int y0
Definition: bbox.hpp:32
PIC_INLINE ImageVec Double(Image *img1, Image *img2)
Double creates an std::vector which contains img1 and img2; this is for filters input.
Definition: image_vec.hpp:49
int minInputImages
Definition: filter_radial_basis_function.hpp:56
The FilterConv2D class.
Definition: filter_conv_2d.hpp:30
The Image class stores an image as buffer of float.
Definition: image.hpp:60
void ProcessBBox(Image *dst, ImageVec src, BBox *box)
ProcessBBox.
Definition: filter_conv_2d.hpp:40
virtual void f(FilterFData *data)
f
Definition: filter_radial_basis_function.hpp:69
Definition: bilateral_separation.hpp:25
static T * assign(T *data, int size, T *ret)
assign
Definition: array.hpp:464
int width
Definition: image.hpp:80
int height
Definition: image.hpp:80
static Image * execute(Image *img, Image *conv, Image *imgOut)
execute
Definition: filter_conv_2d.hpp:89