Go to the documentation of this file.00001
00031 #ifndef CoordinateFrame_DEFINED
00032 #define CoordinateFrame_DEFINED
00033
00034
00035 #include "cv.h"
00036 #include "cxcore.h"
00037 #include "highgui.h"
00038 #include <iostream>
00039 #include "Utils3D.h"
00040
00046 class CoordinateFrame
00047 {
00048
00049 public:
00051
00053 CoordinateFrame(CvPoint3D32f position, CvPoint3D32f rotation);
00054 CoordinateFrame(float posX, float posY, float posZ, float rotX, float rotY, float rotZ);
00055 CoordinateFrame(CvPoint3D32f position, float rotX, float rotY, float rotZ);
00056 CoordinateFrame(float posX, float posY, float posZ, CvPoint3D32f rotation);
00057 CoordinateFrame(CvPoint3D32f* p0, CvPoint3D32f* p1, CvPoint3D32f* p2);
00058 CoordinateFrame(cv::Point3f p1, cv::Point3f p2, cv::Point3f p3);
00059 CoordinateFrame(CvMat* trafoMat);
00060 CoordinateFrame();
00061
00063
00065 ~CoordinateFrame();
00066
00068
00070
00072 CvMat* createTransformationMatrix();
00073
00075 CvMat* createTransformationMatrix3x3();
00076
00081 void getThreePoints(CvPoint3D32f* p0,CvPoint3D32f* p1,CvPoint3D32f* p2);
00082
00088 CoordinateFrame * cInFrame(CoordinateFrame * base);
00089
00095 CoordinateFrame * cInWorld(CoordinateFrame * base);
00096
00097 CoordinateFrame * cMakeFrame(CoordinateFrame * base);
00098 CoordinateFrame * cMakeFrame(CvPoint3D32f* p0,CvPoint3D32f* p1,CvPoint3D32f* p2);
00099
00101
00103
00105 CvPoint3D32f * getPos() { return &(this->pos);}
00106
00108 CvPoint3D32f * getRot() { return &(this->rot);}
00109
00111 void setPos(CvPoint3D32f* pos_);
00112
00114 void setRot(CvPoint3D32f* rot_);
00115
00116 void toggleZDirection();
00117
00118
00119 public:
00120 void getXAxis(CvPoint3D32f* normal);
00121 void getYAxis(CvPoint3D32f* normal);
00122 void getZAxis(CvPoint3D32f* normal);
00123
00124
00125 private:
00127 CvPoint3D32f pos;
00129 CvPoint3D32f rot;
00130
00131 };
00132
00133 class CoordinateFrameExt : public CoordinateFrame
00134 {
00135 public:
00136 int error;
00137 int prob;
00138 bool isResult;
00139
00140 public:
00141 CoordinateFrameExt():CoordinateFrame(){}
00142 CoordinateFrameExt(CvPoint3D32f* p1,CvPoint3D32f* p2,CvPoint3D32f* p3):CoordinateFrame(p1,p2,p3){}
00143 };
00144
00145 #endif