summaryrefslogtreecommitdiff
path: root/src/camera.h
blob: 3de64a6492e3b8c6f2240637c41bca3a1b632df9 (plain)
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
#ifndef  camera_INC
#define  camera_INC
#include <Eigen/Dense>
#include <iostream>
#include <yaml-cpp/yaml.h>

#define BINNING 0.5 // set the binning factor
#define YAWCORRECT 2.0
//#define DOYAWCORRECT
using Eigen::Matrix;
using Eigen::Vector4d;
using Eigen::Vector3d;
using Eigen::Quaterniond;
using std::cout;
using std::cerr;
using std::endl;

/*
 * =====================================================================================
 *        Class:  Camera
 *  Description:  Class for the camera.
 * =====================================================================================
 */
class Camera
{
    public:
        /* ====================  LIFECYCLE     ======================================= */
        Camera (const char *fin);                             /* constructor */

        /* ====================  ACCESSORS     ======================================= */
        Vector4d d() const;
        Matrix<double,3,3> K() const;
        Matrix<double,4,4> K4() const;
        Vector3d principalPoint() const;
        Matrix<double,3,3> Rc2b() const;
        Matrix<double,4,4> Rc2b4() const;

        /* ====================  MUTATORS      ======================================= */

        /* ====================  OPERATORS     ======================================= */
        Vector3d img2body(const Vector3d &xi) const;
        Vector3d body2img(const Vector3d &xb) const;

    protected:
        /* ====================  METHODS       ======================================= */

        /* ====================  DATA MEMBERS  ======================================= */

    private:
        /* ====================  METHODS       ======================================= */

        /* ====================  DATA MEMBERS  ======================================= */
        Matrix<double,3,3> _K;
        Matrix<double,4,4> _T;
        Vector4d _d;

}; /* -----  end of class Camera  ----- */


#endif   /* ----- #ifndef camera_INC  ----- */