ViSP  2.6.2
vpCameraParameters.h
1 /****************************************************************************
2  *
3  * $Id: vpCameraParameters.h 3686 2012-04-23 14:23:58Z mbakthav $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2012 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 
244  void printParameters() ;
245  friend VISP_EXPORT std::ostream & operator << (std::ostream & os,
246  const vpCameraParameters &cam);
247 
248 private:
249  static const double DEFAULT_U0_PARAMETER;
250  static const double DEFAULT_V0_PARAMETER;
251  static const double DEFAULT_PX_PARAMETER;
252  static const double DEFAULT_PY_PARAMETER;
253  static const double DEFAULT_KUD_PARAMETER;
254  static const double DEFAULT_KDU_PARAMETER;
255  static const vpCameraParametersProjType DEFAULT_PROJ_TYPE;
256 
257 
258  double px, py ;
259  double u0, v0 ;
260  double kud ;
261  double kdu ;
262 
263  double inv_px, inv_py;
264 
265  vpCameraParametersProjType projModel ;
266 
267 } ;
268 
269 #endif
270 
271 /*
272  * Local variables:
273  * c-basic-offset: 2
274  * End:
275  */
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.