Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TextureTransformDisparity.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 #ifndef __TextureTransformDisparity__hh__
26 #define __TextureTransformDisparity__hh__
27 
28 #include <Base/Common/BIASpragmaStart.hh>
29 #include <Image/TextureTransform.hh>
30 
31 namespace BIAS {
32 
33  /** @class TextureTransformDisparity
34  * @brief analytic properties of x-displacement
35  *
36  * See BIAS::TextureTransform for explanation of methods.
37  * @author koeser 01/2008
38  **/
40  public:
42  P_.newsize(1);
43  P_[0] = 0;
44  }
45 
47 
48  int MapForward(const HomgPoint2D& src, HomgPoint2D& sink) const {
49  sink[0] = src[0] + P_[0];
50  sink[1] = src[1];
51  sink[2] = 1;
52  return 0;
53  }
54 
55  int MapBackward(const HomgPoint2D& sink, HomgPoint2D& src) const {
56  src[0] = sink[0] - P_[0];
57  src[1] = sink[1];
58  src[2] = 1;
59  return 0;
60  }
61 
63  Matrix2x2<double>& Jac) const {
64  Jac.SetIdentity();
65  return 0;
66  }
67 
69  Matrix2x2<double>& Jac) const {
70  Jac.SetIdentity();
71  return 0;
72  }
73 
74  virtual bool TextureJacobianIsConstant() const { return true;};
75 
77  Jac.newsize(2,1);
78  Jac[0][0] = 1;
79  Jac[1][0] = 0;
80  return 0;
81  }
82 
84  Jac.newsize(2,1);
85  Jac[0][0] = -1;
86  Jac[1][0] = 0;
87  return 0;
88  }
89 
90  bool ParameterJacobianIsConstant() const { return true;};
91 
92  /** @brief dx */
93  void SetParameters(const Vector<double>& p) {
94  BIASASSERT(p.Size()==1);
95  P_ = p;
96  }
97 
99  P_[0] -= deltaP[0];
100  }
101 
103  Jac.newsize(1,1);
104  Jac[0][0] = -1;
105  return 0;
106  }
107 
108 
109  virtual TextureTransformDisparity* Clone() const {
110  return new TextureTransformDisparity(*this);
111  }
112  protected:
113 
114  };
115 
116 } // end namespace BIAS
117 
118 #endif
bool ParameterJacobianIsConstant() const
return true, if the parameter jacobian does not depend on the image position
void SetIdentity()
set the elements of this matrix to the identity matrix
Definition: Matrix2x2.hh:251
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
Definition: HomgPoint2D.hh:67
analytic properties of x-displacement
Vector< double > P_
current set of parameters, see SetParameters for meaning
Matrix< T > & newsize(Subscript M, Subscript N)
Definition: cmat.h:269
class for representing parameterized image warps, such as homography, displacement, ...
unsigned int Size() const
length of the vector
Definition: Vector.hh:143
virtual bool TextureJacobianIsConstant() const
return true if the texture jacobian does not depend on the image position
Vector< T > & newsize(Subscript N)
Definition: vec.h:220
int ParameterJacobianBackward(Matrix< double > &Jac, const HomgPoint2D &src)
transformed position change when parameters change
int ParameterInversionJacobian(Matrix< double > &Jac) const
compute parameters for inverse operation and obtain the jacobian of the inverse parameters with respe...
int MapForward(const HomgPoint2D &src, HomgPoint2D &sink) const
map a point in image &quot;source&quot; to a point in image &quot;sink&quot;
void ComposeWithInverseDeltaP(const Vector< double > &deltaP)
concatenate *this and an inverse transform with param deltaP and save new parameter vector to *this...
int TextureJacobianBackward(const HomgPoint2D &sink, Matrix2x2< double > &Jac) const
shape change of the local region when mapping backward
int ParameterJacobianForward(Matrix< double > &Jac, const HomgPoint2D &src)
transformed position change when parameters change
int MapBackward(const HomgPoint2D &sink, HomgPoint2D &src) const
map a point in image &quot;source&quot; to a point in image &quot;sink&quot;
int TextureJacobianForward(const HomgPoint2D &src, Matrix2x2< double > &Jac) const
shape change of the local region when mapping forward
void SetParameters(const Vector< double > &p)
dx
virtual TextureTransformDisparity * Clone() const
virtual covariant copy constructor, caller must eventually destroy the created object ...