SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CameraModel.hpp
Go to the documentation of this file.
1 /*
2  * Copyright(c):
3  * Signal Image and Communications (SIC) Department
4  * http://www.sic.sp2mi.univ-poitiers.fr/
5  * - University of Poitiers, France http://www.univ-poitiers.fr
6  * - XLIM Institute UMR CNRS 7252 http://www.xlim.fr/
7  *
8  * and
9  *
10  * D2 Fluid, Thermic and Combustion
11  * - University of Poitiers, France http://www.univ-poitiers.fr
12  * - PPRIME Institute - UPR CNRS 3346 http://www.pprime.fr
13  * - ISAE-ENSMA http://www.ensma.fr
14  *
15  * Contributor(s):
16  * The SLIP team,
17  * Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>,
18  * Laurent David <laurent.david_AT_lea.univ-poitiers.fr>,
19  * Ludovic Chatellier <ludovic.chatellier_AT_univ-poitiers.fr>,
20  * Lionel Thomas <lionel.thomas_AT_univ-poitiers.fr>,
21  * Denis Arrivault <arrivault_AT_sic.univ-poitiers.fr>,
22  * Julien Dombre <julien.dombre_AT_univ-poitiers.fr>.
23  *
24  * Description:
25  * The Simple Library of Image Processing (SLIP) is a new image processing
26  * library. It is written in the C++ language following as much as possible
27  * the ISO/ANSI C++ standard. It is consequently compatible with any system
28  * satisfying the ANSI C++ complience. It works on different Unix , Linux ,
29  * Mircrosoft Windows and Mac OS X plateforms. SLIP is a research library that
30  * was created by the Signal, Image and Communications (SIC) departement of
31  * the XLIM, UMR 7252 CNRS Institute in collaboration with the Fluids, Thermic
32  * and Combustion departement of the P', UPR 3346 CNRS Institute of the
33  * University of Poitiers.
34  *
35  * The SLIP Library source code has been registered to the APP (French Agency
36  * for the Protection of Programs) by the University of Poitiers and CNRS,
37  * under registration number IDDN.FR.001.300034.000.S.P.2010.000.21000.
38 
39  * http://www.sic.sp2mi.univ-poitiers.fr/slip/
40  *
41  * This software is governed by the CeCILL-C license under French law and
42  * abiding by the rules of distribution of free software. You can use,
43  * modify and/ or redistribute the software under the terms of the CeCILL-C
44  * license as circulated by CEA, CNRS and INRIA at the following URL
45  * http://www.cecill.info.
46  * As a counterpart to the access to the source code and rights to copy,
47  * modify and redistribute granted by the license, users are provided only
48  * with a limited warranty and the software's author, the holder of the
49  * economic rights, and the successive licensors have only limited
50  * liability.
51  *
52  * In this respect, the user's attention is drawn to the risks associated
53  * with loading, using, modifying and/or developing or reproducing the
54  * software by the user in light of its specific status of free software,
55  * that may mean that it is complicated to manipulate, and that also
56  * therefore means that it is reserved for developers and experienced
57  * professionals having in-depth computer knowledge. Users are therefore
58  * encouraged to load and test the software's suitability as regards their
59  * requirements in conditions enabling the security of their systems and/or
60  * data to be ensured and, more generally, to use and operate it in the
61  * same conditions as regards security.
62  *
63  * The fact that you are presently reading this means that you have had
64  * knowledge of the CeCILL-C license and that you accept its terms.
65  */
66 
67 
68 
75 #ifndef SLIP_CAMERAMODEL_HPP
76 #define SLIP_CAMERAMODEL_HPP
77 
78 
79 #include <iostream>
80 #include <cassert>
81 #include "Point2d.hpp"
82 #include "Point3d.hpp"
83 #include "Matrix.hpp"
84 
85 #include <boost/serialization/access.hpp>
86 #include <boost/serialization/split_member.hpp>
87 #include <boost/serialization/version.hpp>
88 
89 namespace slip
90 {
91 
92 template <typename Type>
94 
110 template <typename Type>
111 class CameraModel
112 {
113 typedef CameraModel<Type> self;
114 
115 public:
120 
125  CameraModel(const self& other);
126 
130  virtual ~CameraModel();
131 
132 
145  virtual void read(const std::string& file) = 0;
146 
151  virtual void write(const std::string& file) = 0;
167  self& operator=(const self & other);
182  virtual slip::Point2d<Type> projection(const slip::Point3d<Type>& p) = 0;
183 
191  virtual slip::Point3d<Type> backprojection(const slip::Point2d<Type>& p2, const Type& z) = 0;
192 
204 // virtual void compute(const slip::Matrix<Type>& P, const slip::ArgsStruct &s) = 0;
205 virtual void compute(const slip::Matrix<Type>& P) = 0;
206 
209 protected:
210 
215 
219  CameraModel();
220 
225 private:
226  void copy_attributes(const self& other);
228  template<class Archive>
229  void save(Archive & ar, const unsigned int version) const
230  {
231  }
232  template<class Archive>
233  void load(Archive & ar, const unsigned int version)
234  {
235  }
236  BOOST_SERIALIZATION_SPLIT_MEMBER()
237 }; // end of Camera group
239 }//slip::
240 
241 
242 namespace slip
243 {
244 
245  template<typename Type>
246  inline
248  {}
249 
250  template<typename Type>
251  inline
253  {
254  }
255 
256  template<typename Type>
257  inline
259  {}
260 
261  template<typename Type>
262  inline
265  {
266  if(this != &other)
267  {
268 
269  }
270  return *this;
271  }
272 
273 }//slip::
274 #endif //SLIP_CAMERAMODEL_HPP
275 
virtual slip::Point3d< Type > backprojection(const slip::Point2d< Type > &p2, const Type &z)=0
Computes the 3d world point corresponding to the backprojection of an image point.
friend class boost::serialization::access
virtual void read(const std::string &file)=0
Read the CameraModel from a file.
Provides a class to modelize 3d points.
self & operator=(const self &other)
Assign a CameraModel.
virtual slip::Point2d< Type > projection(const slip::Point3d< Type > &p)=0
Computes the projection of a 3d world point onto the image plane.
virtual void compute(const slip::Matrix< Type > &P)=0
Computes the parameters of a camera model.
This is a point2d class, a specialized version of Point<CoordType,DIM> with DIM = 2...
Definition: Array2d.hpp:132
virtual void write(const std::string &file)=0
Write the CameraModel to a file.
virtual ~CameraModel()
Destructor of the CameraModel.
CameraModel()
Default constructor of CameraModel.
Provides a class to manipulate Numerical Matrix.
Provides a class to modelize 2d points.
Define an abstract CameraModel class.
Definition: CameraModel.hpp:93
This is a point3d class, a specialized version of Point<CoordType,DIM> with DIM = 3...