18 #ifndef PIC_FEATURES_MATCHING_ORB_DESCRIPTOR_HPP 19 #define PIC_FEATURES_MATCHING_ORB_DESCRIPTOR_HPP 23 #include "../base.hpp" 24 #include "../image.hpp" 25 #include "../features_matching/brief_descriptor.hpp" 29 #ifndef PIC_DISABLE_EIGEN 47 void rotate2D(
int x,
int y,
int &x_out,
int &y_out,
float angle)
49 float cosAng = cosf(angle);
50 float sinAng = sinf(angle);
55 x_out = int(x_f * cosAng - y_f * sinAng);
56 y_out = int(x_f * sinAng + y_f * cosAng);
66 for(
uint i = 0; i < 360; i += 12) {
67 int * X_r =
new int[n2];
68 int * Y_r =
new int[n2];
70 float ang = (float(i) *
C_PI_2) / 360.0f;
72 for(
uint j = 0; j < n2; j += 2) {
73 rotate2D(
x[j],
x[j + 1], X_r[j], X_r[j + 1], ang);
74 rotate2D(
y[j],
y[j + 1], Y_r[j], Y_r[j + 1], ang);
93 m =
new std::mt19937(seed);
123 if(!img->checkCoordinates(x0, y0)) {
129 img->getMomentsVal(x0, y0,
S, grad);
131 float theta = atan2f(grad[1], grad[0]);
143 uint index = (
n * theta_nor) >> 8;
std::vector< int *> x_theta
Definition: orb_descriptor.hpp:37
unsigned int uint
Definition: base.hpp:23
void rotate2D(int x, int y, int &x_out, int &y_out, float angle)
rotate2D
Definition: orb_descriptor.hpp:47
int S
Definition: brief_descriptor.hpp:50
~ORBDescriptor()
Definition: orb_descriptor.hpp:104
std::mt19937 * m
Definition: brief_descriptor.hpp:53
The BRIEFDescriptor class.
Definition: brief_descriptor.hpp:47
float sigma_sq
Definition: brief_descriptor.hpp:52
std::vector< int *> y_theta
Definition: orb_descriptor.hpp:37
ORBDescriptor(int S=31, int n=256, unsigned int seed=1)
ORBDescriptor.
Definition: orb_descriptor.hpp:91
const float C_PI_2
Definition: math.hpp:52
void generateSamples(unsigned int n)
generateSamples
Definition: brief_descriptor.hpp:77
void release()
Release deallocates memory.
Definition: brief_descriptor.hpp:191
int * y
Definition: brief_descriptor.hpp:56
uint * getAux(Image *img, int x0, int y0, int *x, int *y, uint *desc=NULL)
getAux computes a descriptor at position (x0,y0) with size n.
Definition: brief_descriptor.hpp:119
int * x
Definition: brief_descriptor.hpp:56
The Image class stores an image as buffer of float.
Definition: image.hpp:60
float sigma_sq_2
Definition: brief_descriptor.hpp:52
The ORBDescriptor class.
Definition: orb_descriptor.hpp:34
#define CLAMPi(x, a, b)
Definition: math.hpp:81
Definition: bilateral_separation.hpp:25
unsigned int n
Definition: brief_descriptor.hpp:51
void rotateSamples()
rotateSamples rotates x and y samples
Definition: orb_descriptor.hpp:62
int halfS
Definition: orb_descriptor.hpp:82