18 #ifndef PIC_ALGORITHMS_PYRAMID_HPP 19 #define PIC_ALGORITHMS_PYRAMID_HPP 21 #include "../base.hpp" 22 #include "../image.hpp" 23 #include "../image_vec.hpp" 24 #include "../util/std_util.hpp" 25 #include "../filtering/filter.hpp" 26 #include "../filtering/filter_gaussian_2d.hpp" 27 #include "../filtering/filter_sampler_2d.hpp" 28 #include "../filtering/filter_sampler_2dsub.hpp" 29 #include "../filtering/filter_sampler_2dadd.hpp" 73 stdVectorClear<Image>(
stack);
74 stdVectorClear<Filter>(
filters);
157 return int(
stack.size());
197 Image *img =
new Image(1, width, height, channels);
252 for(
int i = 0; i < levels; i++) {
258 stack.push_back(tmpG);
261 stack.push_back(tmpG);
264 if(i < (levels - 1)) {
272 stack.push_back(tmpD);
276 printf(
"Pyramid size: %zu\n",
stack.size());
290 if(!
stack[0]->isSimilarType(img)) {
300 for(
int i = 0; i < levels; i++) {
304 if(i == (levels - 1)) {
322 if(
stack.size() < 2) {
326 int n = int(
stack.size()) - 1;
330 for(
int i = n; i >= 2; i--) {
338 for(
int i = n; i >= 2; i--) {
352 for(
unsigned int i = 0; i <
stack.size(); i++) {
363 for(
unsigned int i = 0; i <
stack.size(); i++) {
374 for(
unsigned int i = 0; i <
stack.size(); i++) {
386 for(
unsigned int i = 0; i <
stack.size(); i++) {
The FilterSampler2D class.
Definition: filter_sampler_2d.hpp:32
FilterSampler2DSub * flt_sub
Definition: pyramid.hpp:44
void blend(Pyramid *pyr, Pyramid *weight)
blend
Definition: pyramid.hpp:379
void initFilters()
initFilters
Definition: pyramid.hpp:210
void add(const Pyramid *pyr)
add is the add operator ( += ) between pyramids.
Definition: pyramid.hpp:368
FilterSampler2D * flt_sampler
Definition: pyramid.hpp:43
PIC_INLINE int log2(int n)
log2 computes logarithm in base 2 for integers.
Definition: math.hpp:302
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
void setValue(float value)
SetValue.
Definition: pyramid.hpp:350
ImageVec trackerUp
Definition: pyramid.hpp:48
FilterSampler2DAdd * flt_add
Definition: pyramid.hpp:45
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
void release()
release
Definition: pyramid.hpp:69
void create(Image *img, bool lapGauss, int limitLevel)
create
Definition: pyramid.hpp:229
ImageVec trackerRec
Definition: pyramid.hpp:48
FilterGaussian2D * flt_gauss
Definition: pyramid.hpp:42
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
Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter_npasses.hpp:310
Pyramid(Image *img, bool lapGauss, int limitLevel)
Pyramid.
Definition: pyramid.hpp:186
bool bCreated
Definition: pyramid.hpp:39
void update(Image *img)
update recomputes the pyramid given a compatible image, img.
Definition: pyramid.hpp:280
Image * reconstruct(Image *imgOut)
reconstruct evaluates a Gaussian/Laplacian pyramid.
Definition: pyramid.hpp:320
The FilterSampler2DAdd class.
Definition: filter_sampler_2dadd.hpp:31
#define PIC_INLINE
Definition: base.hpp:33
void setLapGauss(bool lapGauss)
setLapGauss
Definition: pyramid.hpp:108
~Pyramid()
Definition: pyramid.hpp:205
#define MIN(a, b)
Definition: math.hpp:69
The Image class stores an image as buffer of float.
Definition: image.hpp:60
bool lapGauss
Definition: pyramid.hpp:39
The Pyramid class.
Definition: pyramid.hpp:36
The FilterSampler2DSub class.
Definition: filter_sampler_2dsub.hpp:29
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
void mul(const Pyramid *pyr)
mul is the mul operator ( *= ) between pyramids.
Definition: pyramid.hpp:357
bool isValid()
isValid checks if the current image is valid, which means if they have an allocated buffer or not...
int size()
size
Definition: pyramid.hpp:155
int limitLevel
Definition: pyramid.hpp:40
#define MAX(a, b)
Definition: math.hpp:73
The FilterGaussian2D class.
Definition: filter_gaussian_2d.hpp:31
void setNULL()
setNULL
Definition: pyramid.hpp:173
int width
Definition: image.hpp:80
int height
Definition: image.hpp:80
ImageVec stack
Definition: pyramid.hpp:79
std::vector< Filter *> filters
Definition: pyramid.hpp:46