-
Notifications
You must be signed in to change notification settings - Fork 0
/
PoseEstimator.h
67 lines (54 loc) · 1.47 KB
/
PoseEstimator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef POSEESTIMATOR_H
#define POSEESTIMATOR_H
#include <vector>
using std::vector;
#include <armadillo>
using arma::field;
using arma::vec;
using arma::mat;
using arma::norm;
using arma::zeros;
/// class PoseEstimator
/// \brief Abstract class providing P3P pose estimation.
///
/// This class provides the basic means of P3P estimation. It is used by the concrete
/// implementation classes PoseLM and PoseRN, specifying the kind of minimization
/// algorithm that is chosen by the user.
///
/// @see PoseLM
/// @see PoseRN
class PoseEstimator
{
public:
PoseEstimator( field< vec > imgPts,
field< vec > objPts,
vec pxPitch,
double focal_length,
vec initial_values );
virtual ~PoseEstimator();
// set methods
void setImgPts( field< vec > newImgPts );
// get methods
field< vec > getPose() const;
vec getParams() const;
protected:
field< vec > iPts;
const field< vec > oPts;
const vec px2si;
const double fl;
const vec p0;
field< vec > estPts;
field< vec > q;
field< vec > Q;
vector< double > x;
mat J;
vec e;
vec p;
vec p_n;
mat calcJac( vec A );
vec f( vec A );
void initAttributes();
virtual void runEstimator();
virtual void printResults() const = 0;
};
#endif // POSEESTIMATOR_H