7 #ifndef NUKLEI_PLANE_PROJECTION_H
8 #define NUKLEI_PLANE_PROJECTION_H
14 #ifdef NUKLEI_USE_CIMG
18 namespace cimg_library
20 template<
typename T>
class CImg;
30 typedef unsigned char pixel_t;
31 #ifdef NUKLEI_USE_CIMG
32 typedef cimg_library::CImg<pixel_t> image_t;
37 PlaneProjection(
const std::string& opencvStereoCalibFile,
unsigned camNum = 0);
42 Vector3 getCamPosition()
const;
43 Quaternion getCamOrientation()
const;
45 std::vector<Vector2> project(
const std::vector<Vector3> worldPoints)
const;
46 Vector2 project(
const Vector3& p)
const;
48 void readImage(
const std::string& name);
49 void writeImage(
const std::string& name)
const;
51 const NUKLEI_UNIQUE_PTR<Color> getColor()
const;
52 void setColor(
const Color& c);
54 weight_t getOpacity()
const {
return opacity_; }
55 void setOpacity(
const weight_t opacity) { opacity_ = opacity; }
57 const image_t& getImage()
const {
58 #ifdef NUKLEI_USE_CIMG
66 void readParameters(
const std::string& opencvStereoCalibFile,
unsigned camNum);
68 std::vector<double> rotationMatrixData_, translationVectorData_,
69 intrinsicMatrixData_, distortionCoeffsData_;
74 #ifdef NUKLEI_USE_CIMG
75 NUKLEI_UNIQUE_PTR<image_t> image_;
81 typedef unsigned char pixel_t;
82 #ifdef NUKLEI_USE_CIMG
83 typedef cimg_library::CImg<pixel_t> image_t;
89 left_(opencvStereoCalibFile, 0),
90 right_(opencvStereoCalibFile, 1)
98 void project(
const std::vector<Vector3> worldPoints)
const
100 left_.project(worldPoints);
101 right_.project(worldPoints);
104 void readLeftImage(
const std::string& name)
106 left_.readImage(name);
108 void readRightImage(
const std::string& name)
110 right_.readImage(name);
112 void writeStereoImage(
const std::string& name)
const;
114 const NUKLEI_UNIQUE_PTR<Color> getColor()
const;
115 void setColor(
const Color& c);
117 weight_t getOpacity()
const {
return opacity_; }
118 void setOpacity(
const weight_t opacity)
119 { opacity_ = opacity; left_.setOpacity(opacity_); right_.setOpacity(opacity_); }