18 #ifndef PIC_FEATURES_MATCHING_POISSON_DESCRIPTOR_HPP 19 #define PIC_FEATURES_MATCHING_POISSON_DESCRIPTOR_HPP 22 #include "../util/math.hpp" 23 #include "../image.hpp" 24 #include "../point_samplers/sampler_random.hpp" 58 unsigned int *
getAux(
Image *img,
int x0,
int y0,
unsigned int *desc = NULL)
60 unsigned int bits =
sizeof(
unsigned int) * 8;
65 memset(desc, 0,
sizeof(
unsigned int) *
subBlock);
83 float *p_x_val = (*img)(x0 + x[0], y0 + x[1]);
84 float *p_y_val = (*img)(x0 + y[0], y0 + y[1]);
89 for(
int k = 0; k < img->
channels; k++) {
97 unsigned int ret = (p_x < p_y) ? 1 : 0;
98 desc[p] += (ret << shift);
117 m =
new std::mt19937(seed);
147 unsigned int *
get(
Image *img,
int x0,
int y0,
unsigned int *desc = NULL)
153 if(!img->checkCoordinates(x0, y0)) {
157 return getAux(img, x0, y0, desc);
~PoissonDescriptor()
Definition: poisson_descriptor.hpp:122
int getDescriptorSize()
getDescriptorSize returns the descriptor size.
Definition: poisson_descriptor.hpp:164
int channels
Definition: image.hpp:80
RandomSampler< 2 > * rs
Definition: poisson_descriptor.hpp:38
void release()
release deallocates memory.
Definition: poisson_descriptor.hpp:130
void generateSamples(unsigned int kernelSize)
generateSamples
Definition: poisson_descriptor.hpp:44
int kernelSize
Definition: poisson_descriptor.hpp:34
unsigned int * getAux(Image *img, int x0, int y0, unsigned int *desc=NULL)
getAux computes a descriptor at position (x0,y0) with size n.
Definition: poisson_descriptor.hpp:58
std::vector< int > samplesR
Definition: display.hpp:53
std::mt19937 * m
Definition: poisson_descriptor.hpp:36
The PoissonDescriptor class.
Definition: poisson_descriptor.hpp:31
The Image class stores an image as buffer of float.
Definition: image.hpp:60
int nSamples
Definition: poisson_descriptor.hpp:34
Definition: point_samplers.hpp:51
unsigned int subBlock
Definition: poisson_descriptor.hpp:35
Definition: bilateral_separation.hpp:25
PoissonDescriptor(int kernelSize=16, unsigned int seed=1)
PoissonDescriptor.
Definition: poisson_descriptor.hpp:114
The RandomSampler class.
Definition: sampler_random.hpp:43