ViSP  2.7.0
vpCameraParameters.h
1 /****************************************************************************
2  *
3  * $Id: vpCameraParameters.h 4114 2013-02-07 13:26:03Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Camera intrinsic parameters.
36  *
37  * Authors:
38  * Eric Marchand
39  * Anthony Saunier
40  *
41  *****************************************************************************/
42 
43 
44 
52 #ifndef vpCAMERA_H
53 #define vpCAMERA_H
54 
55 #include <visp/vpMatrix.h>
56 
197 class VISP_EXPORT vpCameraParameters
198 {
201 public :
202  typedef enum{
204  perspectiveProjWithDistortion
205  } vpCameraParametersProjType ;
206 
207 
208  //generic functions
211  vpCameraParameters(const double px, const double py,
212  const double u0, const double v0) ;
213  vpCameraParameters(const double px, const double py,
214  const double u0, const double v0,
215  const double kud, const double kdu) ;
216 
217  vpCameraParameters& operator =(const vpCameraParameters &c) ;
218  virtual ~vpCameraParameters() ;
219 
220  void init() ;
221  void init(const vpCameraParameters &c) ;
222  void initFromCalibrationMatrix(const vpMatrix& _K);
223 
224  void initPersProjWithoutDistortion(const double px, const double py,
225  const double u0, const double v0) ;
226  void initPersProjWithDistortion(const double px, const double py,
227  const double u0, const double v0, const double kud,const double kdu) ;
228 
229  inline double get_px() const { return px; }
230  inline double get_px_inverse() const {return inv_px; }
231  inline double get_py_inverse() const {return inv_py; }
232  inline double get_py() const { return py; }
233  inline double get_u0() const { return u0; }
234  inline double get_v0() const { return v0; }
235  inline double get_kud() const { return kud; }
236  inline double get_kdu() const { return kdu; }
237 
239  return projModel;
240  }
241 
242  vpMatrix get_K() const;
243  vpMatrix get_K_inverse() const;
244 
245  void printParameters() ;
246  friend VISP_EXPORT std::ostream & operator << (std::ostream & os,
247  const vpCameraParameters &cam);
248 
249 private:
250  static const double DEFAULT_U0_PARAMETER;
251  static const double DEFAULT_V0_PARAMETER;
252  static const double DEFAULT_PX_PARAMETER;
253  static const double DEFAULT_PY_PARAMETER;
254  static const double DEFAULT_KUD_PARAMETER;
255  static const double DEFAULT_KDU_PARAMETER;
256  static const vpCameraParametersProjType DEFAULT_PROJ_TYPE;
257 
258 
259  double px, py ;
260  double u0, v0 ;
261  double kud ;
262  double kdu ;
263 
264  double inv_px, inv_py;
265 
266  vpCameraParametersProjType projModel ;
267 
268 } ;
269 
270 #endif
271 
272 /*
273  * Local variables:
274  * c-basic-offset: 2
275  * End:
276  */
Definition of the vpMatrix class.
Definition: vpMatrix.h:96
double get_u0() const
Perspective projection without distortion model.
double get_px_inverse() const
double get_py_inverse() const
double get_py() const
double get_v0() const
Generic class defining intrinsic camera parameters.
double get_px() const
double get_kud() const
Conversion from normalized coordinates in meter to pixel coordinates .
vpCameraParametersProjType get_projModel() const
double get_kdu() const
Conversion from pixel coordinates to normalized coordinates in meter.