Go to the documentation of this file.00001
00002 #ifndef vpgl_calibration_matrix_h_
00003 #define vpgl_calibration_matrix_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <vgl/vgl_fwd.h>
00019 #include <vnl/vnl_fwd.h>
00020 #include <vnl/vnl_matrix_fixed.h>
00021 #include <vgl/vgl_point_2d.h>
00022
00023
00024
00025
00026
00027 template <class T>
00028 class vpgl_calibration_matrix
00029 {
00030 public:
00031
00032 vpgl_calibration_matrix();
00033
00034
00035 virtual ~vpgl_calibration_matrix() {}
00036
00037
00038
00039 vpgl_calibration_matrix( T focal_length, const vgl_point_2d<T>& principal_point,
00040 T x_scale = (T)1, T y_scale = (T)1, T skew = (T)0 );
00041
00042
00043
00044 vpgl_calibration_matrix( const vnl_matrix_fixed<T,3,3>& K );
00045
00046
00047 vnl_matrix_fixed<T,3,3> get_matrix() const;
00048
00049
00050 void set_focal_length( T new_focal_length );
00051 void set_principal_point( const vgl_point_2d<T>& new_principal_point );
00052 void set_x_scale( T new_x_scale );
00053 void set_y_scale( T new_y_scale );
00054 void set_skew( T new_skew );
00055
00056 T focal_length() const { return focal_length_; }
00057 vgl_point_2d<T> principal_point() const { return principal_point_; }
00058 T x_scale() const { return x_scale_; }
00059 T y_scale() const { return y_scale_; }
00060 T skew() const { return skew_; }
00061
00062
00063 bool operator==(vpgl_calibration_matrix<T> const &that) const;
00064 bool operator!=(vpgl_calibration_matrix<T> const &that) const
00065 {return !(*this==that);}
00066
00067
00068 vgl_point_2d<T> map_to_focal_plane(vgl_point_2d<T> const& p_image) const;
00069
00070 vgl_point_2d<T> map_to_image(vgl_point_2d<T> const& p_focal_plane) const;
00071
00072 protected:
00073
00074 T focal_length_;
00075 vgl_point_2d<T> principal_point_;
00076 T x_scale_, y_scale_, skew_;
00077 };
00078
00079
00080
00081 #endif // vpgl_calibration_matrix_h_