00001 #ifndef LOPER_IMAGECALIBRATOR
00002 #define LOPER_IMAGECALIBRATOR
00003
00014 #include <vector>
00015 using std::vector;
00016 #include "GslMatrix.hpp"
00017
00019 class PointCorrespondence
00020 {
00021 public:
00022 bool operator<(const PointCorrespondence &pc) const
00023 {
00024 return (memcmp(this, &pc, sizeof(PointCorrespondence)) < 0);
00025 }
00026 double x,y;
00027 double u,v;
00028 };
00029
00030 typedef vector< vector < double > > Table;
00031
00032 GslVector getNullspaceVector (GslMatrix table);
00033
00034
00035
00043 class ImageCalibrator
00044 {
00045 public:
00046
00047
00048
00049
00050 ImageCalibrator() :
00051 homography(3,3),
00052 rotation(3),
00053 translation(3)
00054 {
00055 }
00056
00057
00058
00059
00060 void recalculateHomography();
00061
00062
00063
00064
00065 void printPoints();
00066 void printHomography();
00067
00068
00069
00070
00071 std::vector< PointCorrespondence > points;
00072
00073
00074 GslMatrix homography;
00075 GslVector rotation;
00076 GslVector translation;
00077 };
00078
00079
00080
00081 #endif // LOPER_IMAGECALIBRATOR