CSimpleLensCorrection.h
Go to the documentation of this file.
1 #ifndef icalib_CSimpleLensCorrection_included
2 #define icalib_CSimpleLensCorrection_included
3 
4 
5 // ACF includes
6 #include <i2d/ICalibration2d.h>
7 #include <i2d/CVector2d.h>
8 
9 
10 namespace icalib
11 {
12 
13 
18 {
19 public:
21  explicit CSimpleLensCorrection(const i2d::CVector2d& opticalCenter, double distortionFactor = 0, double scaleFactor = 1);
22 
26  void Reset(const i2d::CVector2d& opticalCenter = i2d::CVector2d::GetZero(), double distortionFactor = 0, double scaleFactor = 1);
27 
28  const i2d::CVector2d& GetOpticalCenter() const;
29  virtual void SetOpticalCenter(const i2d::CVector2d& center);
30 
31  double GetDistortionFactor() const;
32  virtual void SetDistortionFactor(double factor);
33 
34  double GetScaleFactor() const;
35  virtual void SetScaleFactor(double factor);
36 
37  bool operator==(const CSimpleLensCorrection& calib) const;
38  bool operator!=(const CSimpleLensCorrection& calib) const;
39 
40  // reimplemented (i2d::ICalibration2d)
41  virtual const i2d::CRectangle* GetArgumentArea() const;
42  virtual const i2d::CRectangle* GetResultArea() const;
43  virtual const imath::IUnitInfo* GetArgumentUnitInfo() const;
44  virtual const imath::IUnitInfo* GetResultUnitInfo() const;
45  virtual const ICalibration2d* CreateCombinedCalibration(const ITransformation2d& transformation) const;
46 
47  // reimplemented (i2d::ITransformation2d)
48  virtual int GetTransformationFlags() const;
49  virtual bool GetDistance(
50  const i2d::CVector2d& origPos1,
51  const i2d::CVector2d& origPos2,
52  double& result,
53  ExactnessMode mode = EM_NONE) const;
54  virtual bool GetPositionAt(
55  const i2d::CVector2d& origPosition,
56  i2d::CVector2d& result,
57  ExactnessMode mode = EM_NONE) const;
58  virtual bool GetInvPositionAt(
59  const i2d::CVector2d& transfPosition,
60  i2d::CVector2d& result,
61  ExactnessMode mode = EM_NONE) const;
62  virtual bool GetLocalTransform(
63  const i2d::CVector2d& origPosition,
64  i2d::CAffine2d& result,
65  ExactnessMode mode = EM_NONE) const;
66  virtual bool GetLocalInvTransform(
67  const i2d::CVector2d& transfPosition,
68  i2d::CAffine2d& result,
69  ExactnessMode mode = EM_NONE) const;
70 
71  // reimplemented (imath::TISurjectFunction)
72  virtual bool GetInvValueAt(const i2d::CVector2d& argument, i2d::CVector2d& result) const;
73  virtual i2d::CVector2d GetInvValueAt(const i2d::CVector2d& argument) const;
74 
75  // reimplemented (imath::TIMathFunction)
76  virtual bool GetValueAt(const i2d::CVector2d& argument, i2d::CVector2d& result) const;
77  virtual i2d::CVector2d GetValueAt(const i2d::CVector2d& argument) const;
78 
79  // reimplemented (iser::ISerializable)
80  virtual bool Serialize(iser::IArchive& archive);
81 
82  // reimplemented (istd::IChangeable)
83  virtual int GetSupportedOperations() const;
84  virtual bool CopyFrom(const istd::IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS);
85  virtual bool IsEqual(const istd::IChangeable& object) const;
86  virtual istd::IChangeable* CloneMe(CompatibilityMode mode = CM_WITHOUT_REFS) const;
87  virtual bool ResetData(CompatibilityMode mode = CM_WITHOUT_REFS);
88 
89 private:
90  i2d::CVector2d m_opticalCenter;
91 
92  double m_distortionFactor;
93  double m_scaleFactor;
94 };
95 
96 
97 // inline methods
98 
100 {
101  return !operator==(calib);
102 }
103 
104 
105 } // namespace icalib
106 
107 
108 #endif // !icalib_CSimpleLensCorrection_included
109 
110 
virtual void SetScaleFactor(double factor)
virtual int GetTransformationFlags() const
virtual const ICalibration2d * CreateCombinedCalibration(const ITransformation2d &transformation) const
virtual void SetOpticalCenter(const i2d::CVector2d &center)
virtual istd::IChangeable * CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const
void Reset(const i2d::CVector2d &opticalCenter=i2d::CVector2d::GetZero(), double distortionFactor=0, double scaleFactor=1)
Reset this calibration, set to be identity transform.
virtual bool GetLocalInvTransform(const i2d::CVector2d &transfPosition, i2d::CAffine2d &result, ExactnessMode mode=EM_NONE) const
virtual const imath::IUnitInfo * GetResultUnitInfo() const
virtual void SetDistortionFactor(double factor)
bool operator!=(const CSimpleLensCorrection &calib) const
virtual bool GetInvPositionAt(const i2d::CVector2d &transfPosition, i2d::CVector2d &result, ExactnessMode mode=EM_NONE) const
Represents simple correction of image distortion by lenses.
virtual int GetSupportedOperations() const
virtual bool Serialize(iser::IArchive &archive)
const i2d::CVector2d & GetOpticalCenter() const
virtual bool GetInvValueAt(const i2d::CVector2d &argument, i2d::CVector2d &result) const
virtual bool GetPositionAt(const i2d::CVector2d &origPosition, i2d::CVector2d &result, ExactnessMode mode=EM_NONE) const
virtual const i2d::CRectangle * GetArgumentArea() const
virtual bool CopyFrom(const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
virtual bool IsEqual(const istd::IChangeable &object) const
double GetScaleFactor() const
virtual bool GetLocalTransform(const i2d::CVector2d &origPosition, i2d::CAffine2d &result, ExactnessMode mode=EM_NONE) const
virtual bool ResetData(CompatibilityMode mode=CM_WITHOUT_REFS)
bool operator==(const CSimpleLensCorrection &calib) const
static const CVector2d & GetZero()
virtual bool GetDistance(const i2d::CVector2d &origPos1, const i2d::CVector2d &origPos2, double &result, ExactnessMode mode=EM_NONE) const
virtual const i2d::CRectangle * GetResultArea() const
virtual const imath::IUnitInfo * GetArgumentUnitInfo() const
double GetDistortionFactor() const
virtual bool GetValueAt(const i2d::CVector2d &argument, i2d::CVector2d &result) const

© 2007-2017 Witold Gantzke and Kirill Lepskiy