PICCANTE  0.4
The hottest HDR imaging library!
filter_reconstruct.hpp
Go to the documentation of this file.
1 /*
2 
3 PICCANTE
4 The hottest HDR imaging library!
5 http://vcg.isti.cnr.it/piccante
6 
7 Copyright (C) 2014
8 Visual Computing Laboratory - ISTI CNR
9 http://vcg.isti.cnr.it
10 First author: Francesco Banterle
11 
12 This Source Code Form is subject to the terms of the Mozilla Public
13 License, v. 2.0. If a copy of the MPL was not distributed with this
14 file, You can obtain one at http://mozilla.org/MPL/2.0/.
15 
16 */
17 
18 #ifndef PIC_FILTERING_FILTER_RECONSTRUCT_HPP
19 #define PIC_FILTERING_FILTER_RECONSTRUCT_HPP
20 
21 #include "../util/array.hpp"
22 
23 #include "../filtering/filter.hpp"
24 
25 namespace pic {
26 
28 {
29 protected:
30 
37  void ProcessBBox(Image *dst, ImageVec src, BBox *box)
38  {
39  int channels = src[0]->channels;
40 
41  for(int j = box->y0; j < box->y1; j++) {
42 
43  for(int i = box->x0; i < box->x1; i++) {
44  float *tmp_ann = (*src[1])(i, j);
45  int x = int(tmp_ann[0]);
46  int y = int(tmp_ann[1]);
47 
48  float *tmp_dst = (*dst)(i, j);
49  float *tmp_src = (*src[0])(x, y);
50 
51  Arrayf::assign(tmp_src, channels, tmp_dst);
52  }
53  }
54  }
55 
56 public:
61  {
62  minInputImages = 2;
63  }
64 
73  virtual void OutputSize(ImageVec imgIn, int &width, int &height, int &channels, int &frames)
74  {
75  width = imgIn[1]->width;
76  height = imgIn[1]->height;
77  channels = imgIn[1]->channels;
78  frames = imgIn[1]->frames;
79  }
80 
88  static Image *execute(Image *imgIn, Image *ann, Image *imgOut = NULL)
89  {
90  FilterReconstruct fltRec;
91  return fltRec.Process(Double(imgIn, ann), imgOut);
92  }
93 };
94 
95 } // end namespace pic
96 
97 #endif /* PIC_FILTERING_FILTER_RECONSTRUCT_HPP */
The BBox class manages the creation of bounding boxes for images.
Definition: bbox.hpp:29
virtual void OutputSize(ImageVec imgIn, int &width, int &height, int &channels, int &frames)
OutputSize.
Definition: filter_reconstruct.hpp:73
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
int x0
Definition: bbox.hpp:32
static Image * execute(Image *imgIn, Image *ann, Image *imgOut=NULL)
execute
Definition: filter_reconstruct.hpp:88
FilterReconstruct()
FilterReconstruct.
Definition: filter_reconstruct.hpp:60
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
void ProcessBBox(Image *dst, ImageVec src, BBox *box)
ProcessBBox.
Definition: filter_reconstruct.hpp:37
Definition: filter_reconstruct.hpp:27
The Image class stores an image as buffer of float.
Definition: image.hpp:60
Definition: bilateral_separation.hpp:25
static T * assign(T *data, int size, T *ret)
assign
Definition: array.hpp:464