Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PlanarRectification.hh
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5 Multimediale Systeme der Informationsverarbeitung
6 Institut fuer Informatik
7 Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 
26 #ifndef __PlanarRectification_hh__
27 #define __PlanarRectification_hh__
28 
29 #include <Image/RectificationViaProjectionMappingBase.hh>
30 
31 namespace BIAS {
32 
33  /**
34  * Rectification via perspective cameras, removes distortions.
35  * Only works with perspective cameras for now.
36  * \ingroup Stereo
37  * \ingroup g_filter
38  * \author bartczak 03/2007
39  */
40  template <class InputStorageType, class OutputStorageType>
41  class BIASImage_EXPORT PlanarRectification :
42  public RectificationViaProjectionMappingBase<InputStorageType,
43  OutputStorageType>
44  {
45  public:
48 
49  /** Only works with perspective cameras */
50  virtual bool
51  IsInputCameraValid(const BIAS::Image<InputStorageType>& img,
52  const BIAS::ProjectionParametersBase* proj);
53  /** @} */
54 
55  void FixateRectOrientation(const Quaternion<double>& rectOrientation);
56  void FixateIntrinsics(const ProjectionParametersPerspective& ppp);
57  void FixateIntrinsics(const ProjectionParametersPerspective& pppA,
59 
60  /** If this is set to true, the rectification will use the mean of the
61  * input pixel aspect ratios for the target cameras' pixel aspect ratio.
62  * \attention rethink what this might mean when using a non perspective
63  * camera model.
64  **/
65  void RetainOriginalApectRatio(bool retain=true);
66 
67 
68  protected:
69 
70  /** current implementation is suboptimal, a beter way for the choise of
71  * internal parameters must be found. Currently the CameraA parameters without
72  * the distortion are chosen.
73  */
74  virtual int DetermineRectificationParameters_();
75 
78 
82 
84 
85  };
86 
87 
88 }//end of namespace
89 
90 #endif
Base class for rectification implementations that make use of projections to represent rectified stat...
camera parameters which define the mapping between rays in the camera coordinate system and pixels in...
ProjectionParametersPerspective fixedIntrinsicsA_
Quaternion< double > rectOrientation_
Rectification via perspective cameras, removes distortions.
ProjectionParametersPerspective fixedIntrinsicsB_
Camera parameters which define the mapping between rays in the camera coordinate system and pixels in...