18 #ifndef PIC_FEATURES_MATCHING_LUCID_DESCRIPTOR_HPP 19 #define PIC_FEATURES_MATCHING_LUCID_DESCRIPTOR_HPP 21 #include "../util/math.hpp" 22 #include "../image.hpp" 63 unsigned int *
get(
Image *img,
int x0,
int y0,
unsigned int *desc,
unsigned int &nDesc)
69 nDesc =
area * img->channels;
72 desc =
new unsigned int[nDesc];
75 std::vector< std::pair<float, unsigned int> > data;
78 for(
int k = 0; k < img->channels; k++) {
85 float *tmp_val = (*img)(x, y);
88 int s = int(data.size());
90 std::pair<float, int> pair = std::make_pair(f, s);
96 std::sort(data.begin(), data.end());
98 for(
unsigned int i = 0; i < data.size(); i++) {
99 desc[i] = data[i].second;
112 static unsigned int match(
unsigned int *fv0,
unsigned int *fv1,
unsigned int nfv)
114 if((fv0 == NULL) && (fv1 == NULL)) {
118 unsigned int ret = 0;
120 for(
unsigned int i = 0; i < nfv; i++) {
121 ret += (fv0[i] == fv1[i]) ? 1 : 0;
LUCIDDescriptor(int patchSize=31)
LUCIDDescriptor.
Definition: lucid_descriptor.hpp:41
int halfPatchSize
Definition: lucid_descriptor.hpp:32
int area
Definition: lucid_descriptor.hpp:33
int patchSize
Definition: lucid_descriptor.hpp:32
The LUCIDDescriptor class.
Definition: lucid_descriptor.hpp:29
The Image class stores an image as buffer of float.
Definition: image.hpp:60
Definition: bilateral_separation.hpp:25
static unsigned int match(unsigned int *fv0, unsigned int *fv1, unsigned int nfv)
match matches two descriptors. Note: higher scores means better matching.
Definition: lucid_descriptor.hpp:112