sugr
Class Homography_2D

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

public class Homography_2D
extends Transformation

This class contains constructors to build a Homography_2D. Its matrix has 9 entries, but 8 needs to be set due to homogenity A homography_2D consists of:

Version:
1.1 (26.1.2004) Achim Königs Changed Constructor Homography_2D(double hom[], Matrix cov) to accept 9 values for the Matrix and to accept them by counting up the rows, befor the colums.
Author:
Norbert Fischer
See Also:
Serialized Form

Field Summary
protected static int DIM
          dimension must be set.
private static long serialVersionUID
          Class version number for serialization
 
Fields inherited from class sugr.Element
cov, MAXITER, v
 
Constructor Summary
Homography_2D()
          standard constructor.
Homography_2D(Affinity_2D aff, Vector projective)
          Creates a homography by an affinity and the projective part.
Homography_2D(Affinity_2D aff, Vector projective, Matrix cov)
          Creates a homography with covariane by an affinity and the projective part.
Homography_2D(double[] hom)
          sets Homography_2D by hand. positions are:
|hom[0] hom[1] hom[2] | |hom[3] hom[4] hom[5] | |hom[6] hom[7] hom[8] |
Homography_2D(double[] hom, Matrix cov)
          sets Homography_2D with covariance by hand. positions are:
|hom[0] hom[1] hom[2] | |hom[3] hom[4] hom[5] | |hom[6] hom[7] hom[8] |
Homography_2D(Homography_2D h1, Homography_2D h2)
          Creates a homography out of two given homographies: H=h1*h2
Homography_2D(Matrix hom, Matrix cov)
          Constructs a homography out of a given homography matrix and a covariance matrix for the given homography.
Homography_2D(Point_2D x11, Point_2D x12, Point_2D x21, Point_2D x22, Point_2D x31, Point_2D x32, Point_2D x41, Point_2D x42)
          Creates homography from four homologous points All points need to have covariance matrices of rank at least two.
 
Method Summary
 void doCondition(double[] f)
          Condition that element with a set of conditioning factors.
 int getDegreesOfFreedom()
          Returns the number of elements to specify this transformation
 int getDimCol()
          Get the number of columns of the transformation matrix.
 int getDimRow()
          Get the number of rows of the transformation matrix.
 Matrix getJacobianAfterFirst(Entity e)
          The the Jacobian after the first entity of a trilinear relation.
 Matrix getJacobianAfterSecond(Entity e)
          The the Jacobian after the second entity of a trilinear relation.
 Entity transform(Entity e)
          Transforms an entity with this transformation.
 
Methods inherited from class sugr.Transformation
errorProp, getDimension, getJacobianOfRelation, getReducedAB, getTransformationMatrix, getTransposeTransMatrix, transform
 
Methods inherited from class sugr.Element
approximate, calcCov, changeNullspace, changeNullspace, checkCovDim, checkElement, clone, 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
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Class version number for serialization

See Also:
Constant Field Values

DIM

protected static final int DIM
dimension must be set. Otherwise it's not possible to gain matrix from vector!!! This DIM = 3 is valid FOR ALL SUBCLASSES xxx_2D !

See Also:
Constant Field Values
Constructor Detail

Homography_2D

public Homography_2D()
standard constructor. Creates an identity matrix


Homography_2D

public Homography_2D(Affinity_2D aff,
                     Vector projective)
Creates a homography by an affinity and the projective part. Error propagation is done automatically

Parameters:
aff - contains the affinity part
projective - a vector with dimension 2. contains the projective part of homography_2D

Homography_2D

public Homography_2D(Affinity_2D aff,
                     Vector projective,
                     Matrix cov)
Creates a homography with covariane by an affinity and the projective part. No error propagation will be performed.

Parameters:
aff - contains the affinity part
projective - a vector with dimension 2. contains the projective part of homography_2D
cov - 9x9 matrix

Homography_2D

public Homography_2D(double[] hom)
sets Homography_2D by hand. positions are:
              |hom[0]  hom[1]  hom[2] |
              |hom[3]  hom[4]  hom[5] |
              |hom[6]  hom[7]  hom[8] |
 

Parameters:
hom - a double array containing the values. Must be dimension 9

Homography_2D

public Homography_2D(double[] hom,
                     Matrix cov)
sets Homography_2D with covariance by hand. positions are:
              |hom[0]  hom[1]  hom[2] |
              |hom[3]  hom[4]  hom[5] |
              |hom[6]  hom[7]  hom[8] |
 

Parameters:
hom - a double array containing the values. Must be dimension 8
cov - 9x9 matrix

Homography_2D

public Homography_2D(Matrix hom,
                     Matrix cov)
Constructs a homography out of a given homography matrix and a covariance matrix for the given homography.

Parameters:
hom - a 3x3 homography matrix
cov - 9x9 covariance matrix

Homography_2D

public Homography_2D(Point_2D x11,
                     Point_2D x12,
                     Point_2D x21,
                     Point_2D x22,
                     Point_2D x31,
                     Point_2D x32,
                     Point_2D x41,
                     Point_2D x42)
Creates homography from four homologous points All points need to have covariance matrices of rank at least two.

Parameters:
x11 - first point in first image
x12 - first point in second image
x21 - second point in first image
x22 - second point in second image
x31 - third point in first image
x32 - third point in second image
x41 - fourth point in first image
x42 - fourth point in second image

Homography_2D

public Homography_2D(Homography_2D h1,
                     Homography_2D h2)
Creates a homography out of two given homographies: H=h1*h2

Parameters:
h1 - the first homography
h2 - the second homography
Method Detail

getDegreesOfFreedom

public int getDegreesOfFreedom()
Returns the number of elements to specify this transformation

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

transform

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

Specified by:
transform in class Transformation
Parameters:
e - Entity to transform
Returns:
A new Entity with applied transformation and error propagation

doCondition

public void doCondition(double[] f)
Condition that element with a set of conditioning factors. Because the stored homography matrix is the one for 2D points, the condition-factor-matrix for Point_2D is used.

Specified by:
doCondition in class Element
Parameters:
f - conditioning factors ( two factors for transformations!)

getJacobianAfterFirst

public 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.

Specified by:
getJacobianAfterFirst in class Transformation
Parameters:
e - the second Entity of the relation.

getJacobianAfterSecond

public 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.

Specified by:
getJacobianAfterSecond in class Transformation
Parameters:
e - the first Entity of the relation.

getDimRow

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

Specified by:
getDimRow in class Transformation
Returns:
the number of rows of the transformation matrix.

getDimCol

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

Specified by:
getDimCol in class Transformation
Returns:
the number of columns of the transformation matrix.