sugr
Class Homography_3D

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

public class Homography_3D
extends Transformation

This class contains constructors to build a Homography_3D. Its matrix has 16 entries, but 15 needs to be set due to homogenity A Homography_3D consists of:

Version:
1.1 (26.1.2004) Achim Königs Changed Constructor Homography_3D(double hom[], Matrix cov) to accept 16 parameters and count 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_3D()
          standard constructor.
Homography_3D(Affinity_3D aff, Vector projective)
          Creates a homography by an affinity and the projective part
Homography_3D(Affinity_3D aff, Vector projective, Matrix cov)
          Creates a homography by an affinity and the projective part with covariance.
Homography_3D(double[] hom)
          sets Homography_3D by hand. positions are: |hom[00] hom[01] hom[02] hom[03]| |hom[04] hom[05] hom[06] hom[07]| |hom[08] hom[09] hom[10] hom[11]| |hom[12] hom[13] hom[14] hom[15]|
Homography_3D(double[] hom, Matrix cov)
          sets Homography_3D by hand with covariance. positions are: |hom[00] hom[01] hom[02] hom[03]| |hom[04] hom[05] hom[06] hom[07]| |hom[08] hom[09] hom[10] hom[11]| |hom[12] hom[13] hom[14] hom[15]|
Homography_3D(Homography_3D h1, Homography_3D h2)
          Creates a homography out of two given homographies: H=h1*h2
Homography_3D(Matrix hom, Matrix cov)
          Constructs a homography out of a given homography matrix and a covariance matrix for the given homography.
Homography_3D(Motion_3D mot, Vector scale, Vector shear, Vector projective)
          Creates a Homography_3D by 15 parameters: Motion (6) scale (3) shear (3) projective part of homography (3) Error propagation is done automatically.
Homography_3D(Motion_3D mot, Vector scale, Vector shear, Vector projective, Matrix cov)
          Creates a Homography_3D by 15 parameters PLUS covariance Matrix: Motion (6) scale (3) shear (3) projective part of homography (3) No error propagation will be performed
Homography_3D(Translation_3D trans, Rotation_3D rot, Vector scale, Vector shear, Vector projective)
          Creates a Homography_3D by 15 parameters: Translation (3) Rotation (3) scale (3) shear (3) projective part of homography (3) error propagation is done automatically.
Homography_3D(Translation_3D trans, Rotation_3D rot, Vector scale, Vector shear, Vector projective, Matrix cov)
          Creates a Homography_3D by 15 parameters PLUS covariance Matrix: Translation (3) Rotation (3) scale (3) shear (3) projective part of homography (3) No error propagation will be performed
 
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.
 Matrix getLineMatrix()
          Creates out of this transformation a transformation-matrix for Line_3D See Stephans Diss, pg 52
 Matrix getPlaneMatrix()
          Creates out of this transformation a transformation-matrix for Plane_3D H_plane = H^{-T}
 Matrix getPointMatrix()
          Creates a transformation-matrix for points.
 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 = 4 is valid FOR ALL SUBCLASSES xxx_3D !

See Also:
Constant Field Values
Constructor Detail

Homography_3D

public Homography_3D()
standard constructor. Creates an identity matrix


Homography_3D

public Homography_3D(Affinity_3D aff,
                     Vector projective)
Creates a homography by an affinity and the projective part

Parameters:
aff - contains the affinity part
projective - a vector with dimension 3. Contains the projective part of Homography_3D

Homography_3D

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

Parameters:
aff - contains the affinity part
projective - a vector with dimension 3. Contains the projective part of Homography_3D
cov - 16x16 matrix

Homography_3D

public Homography_3D(double[] hom)
sets Homography_3D by hand. positions are:
     |hom[00]	hom[01]	hom[02]	hom[03]|
     |hom[04] hom[05] hom[06]	hom[07]|
     |hom[08] hom[09] hom[10] hom[11]|
     |hom[12] hom[13] hom[14] hom[15]|
 

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

Homography_3D

public Homography_3D(double[] hom,
                     Matrix cov)
sets Homography_3D by hand with covariance. positions are:
     |hom[00]	hom[01]	hom[02]	hom[03]|
     |hom[04] hom[05] hom[06]	hom[07]|
     |hom[08] hom[09] hom[10] hom[11]|
     |hom[12] hom[13] hom[14] hom[15]|
 

Parameters:
hom - a double array containing the values. Must be dimension 16
cov - 16x16 matrix

Homography_3D

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

Parameters:
hom - a 4x4 homography matrix
cov - 16x16 covariance matrix

Homography_3D

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

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

Homography_3D

public Homography_3D(Translation_3D trans,
                     Rotation_3D rot,
                     Vector scale,
                     Vector shear,
                     Vector projective)
Creates a Homography_3D by 15 parameters: error propagation is done automatically.

Parameters:
trans - a given Translation_3D
rot - a given Rotation_3D
scale - a Vector with dimension 3 containing the scale
shear - Vector containing 6 entries with order:
             xy, xz, yz, yx, zx, zy 
e.g. xy, xz means: x-axis is sheared, with proportional amount of y and z: x' = x + xy*y + xz*z
if you want symmetric shear, set xy=yx, yz=zy and xz=zx
projective - a Vector with dimension 3

Homography_3D

public Homography_3D(Translation_3D trans,
                     Rotation_3D rot,
                     Vector scale,
                     Vector shear,
                     Vector projective,
                     Matrix cov)
Creates a Homography_3D by 15 parameters PLUS covariance Matrix: No error propagation will be performed

Parameters:
trans - a given Translation_3D
rot - a given Rotation_3D
scale - a Vector with dimension 3 containing the scale
shear - Vector containing 6 entries with order:
             xy, xz, yz, yx, zx, zy 
e.g. xy, xz means: x-axis is sheared, with proportional amount of y and z: x' = x + xy*y + xz*z
if you want symmetric shear, set xy=yx, yz=zy and xz=zx
projective - a Vector with dimension 3
cov - 16x16 matrix

Homography_3D

public Homography_3D(Motion_3D mot,
                     Vector scale,
                     Vector shear,
                     Vector projective)
Creates a Homography_3D by 15 parameters: Error propagation is done automatically.

Parameters:
mot - a given Motion_3D
scale - a Vector with dimension 3 containing the scale
shear - Vector containing 6 entries with order:
             xy, xz, yz, yx, zx, zy 
e.g. xy, xz means: x-axis is sheared, with proportional amount of y and z: x' = x + xy*y + xz*z
if you want symmetric shear, set xy=yx, yz=zy and xz=zx
projective - a Vector with dimension 3

Homography_3D

public Homography_3D(Motion_3D mot,
                     Vector scale,
                     Vector shear,
                     Vector projective,
                     Matrix cov)
Creates a Homography_3D by 15 parameters PLUS covariance Matrix: No error propagation will be performed

Parameters:
mot - a given Motion_3D
scale - a Vector with dimension 3 containing the scale
shear - Vector containing 6 entries with order:
             xy, xz, yz, yx, zx, zy 
e.g. xy, xz means: x-axis is sheared, with proportional amount of y and z: x' = x + xy*y + xz*z
if you want symmetric shear, set xy=yx, yz=zy and xz=zx
projective - a Vector with dimension 3
cov - 16x16 matrix
Method Detail

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.

doCondition

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

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

getPointMatrix

public Matrix getPointMatrix()
Creates a transformation-matrix for points. Actually, it is the same like the normal transformation-matrix

Returns:
a (4 x 4)-Matrix

getLineMatrix

public Matrix getLineMatrix()
Creates out of this transformation a transformation-matrix for Line_3D See Stephans Diss, pg 52

Returns:
a (6 x 6)-Matrix

getPlaneMatrix

public Matrix getPlaneMatrix()
Creates out of this transformation a transformation-matrix for Plane_3D H_plane = H^{-T}

Returns:
a (4 x 4)-Matrix

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 tranform and old entity

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

getJacobianAfterFirst

public Matrix getJacobianAfterFirst(Entity e)
The the Jacobian after the first entity of a trilinear relation. For this computation the second entity and the unkown=transformation is needed. esecond= T*efirst For Lines: The used equation comes from formula 3.105 in S. Heuel dissertation. The formulas in table 3.9 are derived from 3.106 and therefore are slightly different. Both possibilities are ok.

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. For this computation the first entity and the unkown=transformation is needed. esecond= T*efirst For Lines: The used equation comes from formula 3.105 in S. Heuel dissertation. The formulas in table 3.9 are derived from 3.106 and therefore are slightly different. Both possibilities are ok.

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