GrayModel.h
Go to the documentation of this file.
00001 //-*-c++-*-
00002 
00003 #ifndef GRAYMODEL_H
00004 #define GRAYMODEL_H
00005 
00006 #include <Eigen/Dense>
00007 #include <vector>
00008 
00009 namespace AprilTags {
00010 
00012 
00017 class GrayModel {
00018 public:
00019   GrayModel();
00020 
00021   void addObservation(float x, float y, float gray);
00022 
00023   inline int getNumObservations() { return nobs; }
00024 
00025   float interpolate(float x, float y);
00026 
00027 private:
00028   void compute();
00029 
00030 // We're solving Av = b.  
00031 //
00032 // For each observation, we add a row to A of the form [x y xy 1]
00033 // and to b of the form gray*[x y xy 1].  v is the vector [c1 c2 c3 c4].
00034 //
00035 // The least-squares solution to the system is v = inv(A'A)A'b
00036 
00037   Eigen::Matrix4d A;
00038   Eigen::Vector4d v;
00039   Eigen::Vector4d b;
00040   int nobs;
00041   bool dirty;  
00042 };
00043 
00044 } // namespace
00045 
00046 #endif


apriltags
Author(s): Mitchell Wills
autogenerated on Thu Aug 27 2015 12:23:28