25 #ifndef __TextureTransformAffine__hh__
26 #define __TextureTransformAffine__hh__
28 #include <Base/Common/BIASpragmaStart.hh>
29 #include <Image/TextureTransform.hh>
44 for (
unsigned int i=0; i<6; i++) P_[i] = 0;
88 A[0][0] = Ainv_[0][0];
89 A[0][1] = Ainv_[0][1];
91 A[1][0] = Ainv_[1][0];
92 A[1][1] = Ainv_[1][1];
95 return ExtractParameters(A);
115 double& A00,
double& A01,
116 double& A10,
double& A11,
117 double& tx,
double& ty) {
118 BIASASSERT(p.
Size()==6);
124 tx = p[4] - (p[0]*origin_[0]+p[1]*origin_[1]);
125 ty = p[5] - (p[2]*origin_[0]+p[3]*origin_[1]);
131 p[0] = A[0][0] - 1.0;
134 p[3] = A[1][1] - 1.0;
136 p[4] = A[0][2] + (p[0]*origin_[0]+p[1]*origin_[1]);
137 p[5] = A[1][2] + (p[2]*origin_[0]+p[3]*origin_[1]);
analytic properties of affine image warp
Matrix2x2< double > Ainv_
class HomgPoint2D describes a point with 2 degrees of freedom in projective coordinates.
const Vector2< double > & GetOrigin() const
origin relative to which rotation and scale is performed
void SetOrigin(const Vector2< double > &origin)
origin relative to which rotation and scale is performed
virtual Vector< double > GetInverseParameters() const
returns parameter vector which undoes the current warp
void InterpretParameters(const Vector< double > &p, double &A00, double &A01, double &A10, double &A11, double &tx, double &ty)
set up A and t from parameters
class for representing parameterized image warps, such as homography, displacement, ...
unsigned int Size() const
length of the vector
virtual bool TextureJacobianIsConstant() const
local warp is the same at any image position
virtual ~TextureTransformAffine()
int TextureJacobianForward(const HomgPoint2D &src, Matrix2x2< double > &Jac) const
shape change of the local region when mapping forward
Vector< double > ExtractParameters(const Matrix3x3< double > &A) const
virtual TextureTransformAffine * Clone() const
virtual covariant copy constructor, caller must eventually destroy the created object ...
int TextureJacobianBackward(const HomgPoint2D &sink, Matrix2x2< double > &Jac) const
shape change of the local region when mapping backward
bool ParameterJacobianIsConstant() const
the jacobian depends on x
Vector2< double > origin_
origin relative to which rotation and scale is performed