projection.h
Go to the documentation of this file.
00001 
00063 #ifndef COB_3D_PROJECTION_H
00064 #define COB_3D_PROJECTION_H
00065 
00066 #include <cob_3d_mapping_common/polygon.h>
00067 
00068 namespace cob_3d_mapping
00069 {
00070   template<typename Vec3T>
00071   inline Eigen::Vector4f makeVector4f(const Vec3T& v, float last=1.0f)
00072   {
00073     return Eigen::Vector4f(v[0], v[1], v[2], last);
00074   }
00075 
00076   template<typename SensorT>
00077   class PerspectiveProjection
00078   {
00079   private:
00080     typedef Eigen::Vector3f Vec3;
00081     typedef Eigen::Vector4f Vec4;
00082     typedef Eigen::Matrix4f Mat4;
00083     typedef typename SensorT::MatMap MatMap;
00084 
00085   public:
00086     /* specialized for cob_3d_mapping::Polygon
00087      * camera_transform: transformation from world to camera
00088      * w,h: size of projected image
00089      * polygons: input polygons
00090      * projection: image vector with polygon ids
00091      */
00092     static void compute(
00093       const Mat4& tf_camera, int w, int h,
00094       const std::vector<cob_3d_mapping::Polygon::Ptr>& polygons,
00095       std::vector<std::vector<int> >& projection);
00096   };
00097 }
00098 
00099 #include "cob_3d_fov_segmentation/impl/projection.hpp"
00100 
00101 #endif


cob_3d_fov_segmentation
Author(s): Georg Arbeiter
autogenerated on Wed Aug 26 2015 11:04:19