cameraIntrinsics.h

Go to the documentation of this file.
00001 
00016 #ifndef DLR_COMPUTERVISION_CAMERAINTRINSICS_H
00017 #define DLR_COMPUTERVISION_CAMERAINTRINSICS_H
00018 
00019 #include <dlrGeometry/ray3D.h>
00020 #include <dlrNumeric/index2D.h>
00021 #include <dlrNumeric/vector2D.h>
00022 #include <dlrNumeric/vector3D.h>
00023 
00024 namespace dlr {
00025 
00026   namespace computerVision {
00027 
00043     class CameraIntrinsics {
00044     public:
00045 
00049       CameraIntrinsics() {};
00050 
00051 
00055       virtual
00056       ~CameraIntrinsics() {}
00057 
00058 
00068       virtual dlr::numeric::Vector2D
00069       project(const dlr::numeric::Vector3D& point) const = 0;
00070 
00071 
00085       virtual inline geometry::Ray3D
00086       reverseProject(const dlr::numeric::Index2D& pixelPosition,
00087                      bool normalize = true) const;
00088 
00089 
00103       virtual geometry::Ray3D
00104       reverseProject(const dlr::numeric::Vector2D& pixelPosition,
00105                      bool normalize = true) const = 0;
00106 
00107 
00108     protected:
00109 
00110     };
00111 
00112   } // namespace computerVision
00113   
00114 } // namespace dlr
00115 
00116 
00117 /* ============ Definitions of inline & template functions ============ */
00118 
00119 
00120 #include <cmath>
00121 
00122 namespace dlr {
00123 
00124   namespace computerVision {
00125 
00126     // This function returns a ray in 3D camera coordinates starting
00127     // at the camera focus, and passing through the center of the
00128     // specified pixel.
00129     inline dlr::geometry::Ray3D
00130     CameraIntrinsics::
00131     reverseProject(const dlr::numeric::Index2D& pixelPosition,
00132                    bool normalize) const
00133     {
00134       return this->reverseProject(
00135         dlr::numeric::Vector2D(pixelPosition.getColumn() + 0.5,
00136                                pixelPosition.getRow() + 0.5),
00137         normalize);
00138     }
00139 
00140   } // namespace computerVision
00141   
00142 } // namespace dlr
00143 
00144 #endif /* #ifndef DLR_COMPUTERVISION_CAMERAINTRINSICS_H */

Generated on Wed Nov 25 12:15:03 2009 for dlrComputerVision Utility Library by  doxygen 1.5.8