OSDN Git Service

bc11a24debec856df41bd444f6beff5250b5d51b
[paldema/paldema.git] / src / cpp / pdcamera.h
1 // Copyright (C) 2009 Masaki Saito <rezoolab@gmail.com>
2 //
3 // pd::Camera
4 // ¤³¤Î¥¯¥é¥¹¤Ï¥«¥á¥é¤ÎÆâÉô¡¢µÚ¤Ó³°Éô¥Ñ¥é¥á¡¼¥¿¤ò¿äÄꤷ¤Þ¤¹¡£
5
6 #ifndef PD_CAMERA_INCLUDED
7 #define PD_CAMERA_INCLUDED
8
9 #include "common.h"
10
11 namespace pd {
12
13 class Camera {
14   public:
15     int scrx;
16     int scry;
17     double fx;
18     double fy;
19     double cx;
20     double cy;
21     double k1;
22     double k2;
23     double p1;
24     double p2;
25     double aspectRatio;
26     CvMat* rotationVector;
27     CvMat* rotationMatrix;
28     CvMat* angleVector;
29     CvMat* angleMatrix;
30     CvMat* translationVector;
31     CvMat* positionVector;
32     bool isDetected;
33     CvMat* cameraMatrix;
34     
35     Camera(int scrx, int scry, double aspectRatio);
36     virtual ~Camera();
37     
38     //Í¿¤¨¤é¤ì¤¿uvºÂɸ¤Èxyz¶õ´Ö¤Ë¤è¤Ã¤Æ¡¢
39     //¥«¥á¥é¤ÎÆâÉô¥Ñ¥é¥á¡¼¥¿¡¢µÚ¤Ó³°Éô¥Ñ¥é¥á¡¼¥¿¤ò¿äÄꤷ¤Þ¤¹¡£
40     void detectParameters(double* uv, double* xyz, int num);
41   protected:
42     CvMat* _makeUVMatrix(double* uv, int num);
43     CvMat* _makeXYZMatrix(double* xyz, int num);
44     CvMat* _makeIntrinsticMatrix();
45   private:
46     DISALLOW_COPY_AND_ASSIGN(Camera);
47 };
48
49 }
50
51 #endif