sugr
Class Transformation

java.lang.Object
  extended bysugr.Element
      extended bysugr.Transformation
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
Homography_2D, Homography_3D, ProjectiveCamera

public abstract class Transformation
extends Element

This class contains main methods for transformations and their special cases. Important to know:

Version:
1.0.1 (25.3.2003): FIXED: defining a variable DIM makes no sense in this class. Subclasses have their own values, they are not "brought" up into this class

Author:
Norbert Fischer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class sugr.Element
cov, MAXITER, v
 
Constructor Summary
Transformation()
           
 
Method Summary
protected  Matrix errorProp(Transformation a, Transformation b)
          calculates the error propagation between two transformations
Note that there is only needed one method for 2D and 3D case
abstract  int getDegreesOfFreedom()
          Returns number of elements to specify a transformation
abstract  int getDimCol()
          Get the number of columns of the transformation matrix.
 int getDimension()
          DIM cannot be used in subclasses' way.
abstract  int getDimRow()
          Get the number of rows of the transformation matrix.
abstract  Matrix getJacobianAfterFirst(Entity e)
          The the Jacobian after the first entity of a trilinear relation.
abstract  Matrix getJacobianAfterSecond(Entity e)
          The the Jacobian after the second entity of a trilinear relation.
 Matrix getJacobianOfRelation(RelationalProperty rp)
          Get the (joint) Jacobian matrix after the observation of a trilinear Relation between two entities and a tranformation.
protected  Matrix[] getReducedAB(RelationalProperty r)
          Get the reduced Matrix A and B from a relational property.
 Matrix getTransformationMatrix()
          If you want to get the Transformation-Matrix (Affinity, Motion, Rotation, Translation) use this method.
static Matrix getTransposeTransMatrix(int size)
          Get a transformation matrix A which transforms vec(Ht)=A*vec(H).
abstract  Entity transform(Entity e)
          Transforms an entity with this transformation.
protected  Entity transform(Matrix h, Matrix covariance, Entity e, java.lang.Class newType)
          Do a transformation with given transformation matrix and covariance of tranformation matrix.
 
Methods inherited from class sugr.Element
approximate, calcCov, changeNullspace, changeNullspace, checkCovDim, checkElement, clone, doCondition, ensureConstraints, estimate, estimate, gaussHelmertIterations, gaussHelmertIterationsOld, getConstraintValue, getCov, getJacobianOfConstraint, getV, normalizeSphere, normalizeSphereComparable, print, print, reduceFirstMatrix, reduceMatrix, reduceMatrix, setCov, setV, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Transformation

public Transformation()
Method Detail

getDegreesOfFreedom

public abstract int getDegreesOfFreedom()
Returns number of elements to specify a transformation

Specified by:
getDegreesOfFreedom in class Element
Returns:
a int containing this number.
e.g.: Affinity_2D needs 6 parameters to be set

transform

public abstract Entity transform(Entity e)
Transforms an entity with this transformation. The new entity contains error propagation of tranform and old entity

Parameters:
e - Entity to transform
Returns:
A new Entity with applied transformation and error propagation

getTransformationMatrix

public Matrix getTransformationMatrix()
If you want to get the Transformation-Matrix (Affinity, Motion, Rotation, Translation) use this method. If you want to get Transformation-Matrix as Vector, use getV(). Matrix is copied.

Returns:
Matrix with dimension DIMxDIM

getDimension

public int getDimension()
DIM cannot be used in subclasses' way. Therefore we need a method to gain the dimension out of the matrix, exactly, out of the vector. This is the dimension of the underlying matrix as vector. For the dimension of the transformation matrix use getDimR, getDimC.

Specified by:
getDimension in class Element
Returns:
an integer containing the dimension of this transformation

getDimRow

public abstract int getDimRow()
Get the number of rows of the transformation matrix.

Returns:
the number of rows of the transformation matrix.

getDimCol

public abstract int getDimCol()
Get the number of columns of the transformation matrix.

Returns:
the number of columns of the transformation matrix.

transform

protected Entity transform(Matrix h,
                           Matrix covariance,
                           Entity e,
                           java.lang.Class newType)
Do a transformation with given transformation matrix and covariance of tranformation matrix. The transformation matrix is not always the one stored in vector v, so it?s given by parameters.

Parameters:
h - tranformation matrix
covariance - covariance matrix of transformation matrix. This is actually the covariance of vec(h).
newType - type of the new transformed entity
Returns:
the new entity of type newType

errorProp

protected Matrix errorProp(Transformation a,
                           Transformation b)
calculates the error propagation between two transformations
Note that there is only needed one method for 2D and 3D case

Parameters:
a - first Transformation
b - second Transformation
Returns:
covariance Matrix containing the error propagation between a and b

getReducedAB

protected Matrix[] getReducedAB(RelationalProperty r)
Get the reduced Matrix A and B from a relational property. A is the Jacobian of this Entity (the unknown), B is the Jacobian of the observation (the relational property). The Jacobian of the oberservation depends (only) on the unknown and the Jacobian of the unknown depends (only) of the oberservation ! This is an overwritten method from element. Due to the structure of the Jacobians for transformation, only the Matrix A is used for reduction. Matrix B includes the transformation matrix which destroys the structure given by PI and Gamma matrixes and therefore the reduction implemented in Element does not work any more.

Overrides:
getReducedAB in class Element
Parameters:
r - the relational Property
Returns:
A in array element 0, B in array Element 1.

getJacobianOfRelation

public Matrix getJacobianOfRelation(RelationalProperty rp)
Get the (joint) Jacobian matrix after the observation of a trilinear Relation between two entities and a tranformation. This joint covariance has always two parts: The first part is the Jacobian after the first entity and the second part is the Jacobian after the second entity.

Specified by:
getJacobianOfRelation in class Element
Parameters:
rp - the relational property which is for transformations always a TrirelationalProperty.
Returns:
Jacobian matrix (This is a part of the constraint formula)

getJacobianAfterFirst

public abstract Matrix getJacobianAfterFirst(Entity e)
The the Jacobian after the first entity of a trilinear relation. second=Transformation*first For this computation the second entity and the unkown=transformation is needed.

Parameters:
e - the second Entity of the relation.

getJacobianAfterSecond

public abstract Matrix getJacobianAfterSecond(Entity e)
The the Jacobian after the second entity of a trilinear relation. second=Transformation*first For this computation the first entity and the unkown=transformation is needed.

Parameters:
e - the first Entity of the relation.

getTransposeTransMatrix

public static Matrix getTransposeTransMatrix(int size)
Get a transformation matrix A which transforms vec(Ht)=A*vec(H). Works for square matrixes H

Parameters:
size - number of rows (and columns) of H