18 #ifndef PIC_ALGORITHMS_PUSHPULL_HPP 19 #define PIC_ALGORITHMS_PUSHPULL_HPP 21 #include "../image.hpp" 22 #include "../image_samplers/image_sampler_bsplines.hpp" 23 #include "../filtering/filter_down_pp.hpp" 24 #include "../filtering/filter_up_pp.hpp" 43 for(
unsigned int i = 1; i <
stack.size(); i++) {
72 void update(
float *value,
float threshold)
100 imgOut = imgIn->
clone();
105 Image *work = imgOut;
108 stack.push_back(imgOut);
114 stack.push_back(tmp);
128 int n = int(
stack.size()) - 2;
130 for(
int i = n; i >= 0; i--) {
148 float *tmp_value =
new float[img->
channels];
149 for(
int i = 0; i < img->
channels; i++) {
150 tmp_value[i] = value;
153 pp.
update(tmp_value, 1e-4f);
154 imgOut = pp.
Process(img, imgOut);
int channels
Definition: image.hpp:80
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
FilterDownPP * flt_down
Definition: pushpull.hpp:35
void update(float *value, float threshold)
update
Definition: filter_up_pp.hpp:86
The PushPull class.
Definition: pushpull.hpp:31
static Image * execute(Image *img, Image *imgOut, float value)
execute
Definition: pushpull.hpp:144
PushPull()
PushPull.
Definition: pushpull.hpp:57
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
void release()
release
Definition: pushpull.hpp:42
void update(float *value, float threshold)
update
Definition: pushpull.hpp:72
The FilterUpPP class.
Definition: filter_up_pp.hpp:32
~PushPull()
Definition: pushpull.hpp:62
FilterUpPP * flt_up
Definition: pushpull.hpp:36
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
void update(float *value, float threshold)
update
Definition: filter_down_pp.hpp:103
The FilterDownPP class.
Definition: filter_down_pp.hpp:30
#define MIN(a, b)
Definition: math.hpp:69
The Image class stores an image as buffer of float.
Definition: image.hpp:60
Image * clone() const
Clone creates a deep copy of the calling instance.
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
Image * Process(Image *imgIn, Image *imgOut)
process computes push-pull.
Definition: pushpull.hpp:93
ImageVec stack
Definition: pushpull.hpp:37
int width
Definition: image.hpp:80
int height
Definition: image.hpp:80