00001
00002
00003 #ifndef _LOCALIZER_HPP
00004 #define _LOCALIZER_HPP
00005
00006 #include "kernel/jafarException.hpp"
00007 #include "jmath/jblas.hpp"
00008 #include "localizer/point2d3d.hpp"
00009 #include <opencv/cv.h>
00010 #include <opencv/cxtypes.h>
00011 #include <opencv/cxcore.h>
00012
00013
00014 namespace jafar {
00015
00016 namespace localizer {
00017
00024 class Localizer {
00025 private:
00027 CvMat* object_points;
00029 CvMat* image_points;
00031 CvMat* intrinsic_matrix;
00033 CvMat* distortion_coeffs;
00035 CvMat* rotation_vector;
00037 CvMat* translation_vector;
00039 jblas::mat M;
00040
00041 public:
00043 Localizer();
00045 Localizer(double* _intrinsic_matrix,
00046 double* _distortion_coeffs);
00048 void setIntrinsicParams(const double& _alphaU,
00049 const double& _alphaV,
00050 const double& _u0,
00051 const double& _v0);
00053 void setCalifeIntrinsicParams(const double& _alphaU,
00054 const double& _alphaV,
00055 const double& _u0,
00056 const double& _v0);
00058 void setDistortionCoefs(const double& _k1,
00059 const double& _k2,
00060 const double& _p1,
00061 const double& _p2);
00063 void setData(const localizer::Points2d3d& points);
00065 void setCalifeData(const localizer::Points2d3d& points);
00067 void localize();
00068
00070 jblas::mat transitionMatrix();
00071
00072 };
00073
00074 }
00075
00076 }
00077 #endif