sugr
Class TriRelationalProperty

java.lang.Object
  extended bysugr.TriRelationalProperty
All Implemented Interfaces:
java.lang.Cloneable, RelationalProperty

public class TriRelationalProperty
extends java.lang.Object
implements RelationalProperty

This class represents trilinear relations. This is used for modeling relations with transformations (projections and homographies). The relation includes two concrete entities (first, second) and the type of the transformation (e.g. a transformation). second=Transformation*first

Author:
Thomas Laebe, ipb

Field Summary
private  Entity first
           
private  Entity second
           
private  java.lang.Class targetType
           
 
Constructor Summary
TriRelationalProperty(Entity _first, Entity _second, java.lang.Class _targetType)
          Construct a trilinear Relation e2= T*e1.
 
Method Summary
 void changeNullspace()
          Changes the nullspace for all entities
private static Matrix ChangeOrderVecTrans(Matrix J)
          Change the order of columns of a matrix in that way that the resulting matrix is J with J*vec(H) =0 whereas the input matrix is J*vec(Ht).
 java.lang.Object clone()
          Clone a relational property.
static double[] doCondition(RelationalProperty[] rprops)
          Do conditioning of the observations.Two factors for all first entities and all second entities are returned.
static void doCondition(RelationalProperty[] rprops, double[] f)
          Do conditioning of the observations.
static double[] doConditionOneFactor(RelationalProperty[] rprops)
          Do conditioning of the observations with one factor.
 void ensureConstraints()
          Ensures, that all elements fulfill their constraints
 Matrix getCovarianceOfJacobianRow(int row)
           Returns the Covariance Matrix of the row-vector of the Jacobian Matrix A of the first Entity and the relation type.
 Matrix getCovarianceOfObservations()
          The the covariance matrix of the observation of that relation.
 int getDof()
          Compute degrees of freedom of that relation.
 Entity getFirstEntity()
          Get the first Entity.
 Matrix getJacobian()
           Return Jacobian Matrix A of the first Entity and the relation type.
 Matrix getJacobianOfObservationConstraints()
          Get the Jacobian of the constraint of the observation
 Vector getObservations()
          Get observation of that relation.
 Matrix getReducedCovarianceOfObservations()
          The "reduced" covariance matrix of the observations which takes care of the homogeneous constraint.
 Entity getSecondEntity()
          Get the second Entity.
 java.lang.Class getTargetType()
          Get the type of the target entity.
 Vector getValueOfObservationConstraints()
          Get the value of the constraint of the observation
 void setObservations(Vector v)
          Set observations of that relation (as a stacked vector).
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

first

private Entity first

second

private Entity second

targetType

private java.lang.Class targetType
Constructor Detail

TriRelationalProperty

public TriRelationalProperty(Entity _first,
                             Entity _second,
                             java.lang.Class _targetType)
Construct a trilinear Relation e2= T*e1.

Parameters:
_first - the first Entity of the relation
_second - the second Entity
_targetType - the type of the element to be estimated e.g. a transformation.
Method Detail

getTargetType

public java.lang.Class getTargetType()
Get the type of the target entity. For estimation, this is the type to be estimated.

Specified by:
getTargetType in interface RelationalProperty
Returns:
the target type

getFirstEntity

public Entity getFirstEntity()
Get the first Entity.


getSecondEntity

public Entity getSecondEntity()
Get the second Entity.


getJacobian

public Matrix getJacobian()

Return Jacobian Matrix A of the first Entity and the relation type.

Specified by:
getJacobian in interface RelationalProperty
Returns:
Jacobian Matrix A


clone

public java.lang.Object clone()
Clone a relational property. The Entities and the target Type are cloned.

Specified by:
clone in interface RelationalProperty
Returns:
a copy of the element.

getDof

public int getDof()
Compute degrees of freedom of that relation.

Specified by:
getDof in interface RelationalProperty
Returns:
degrees of freedom of that relation

getCovarianceOfJacobianRow

public Matrix getCovarianceOfJacobianRow(int row)

Returns the Covariance Matrix of the row-vector of the Jacobian Matrix A of the first Entity and the relation type.

Specified by:
getCovarianceOfJacobianRow in interface RelationalProperty
Parameters:
row - Row vector, for which the Covariance matrix is to be returned
Returns:
covariance of the row vector of the jacobian TODO: implement this

getObservations

public Vector getObservations()
Get observation of that relation. The first part of the vector is the first entity, the second part is the second entity. Used for estimation.

Specified by:
getObservations in interface RelationalProperty
Returns:
the observation for that relation

setObservations

public void setObservations(Vector v)
Set observations of that relation (as a stacked vector). The first part of the vector is the first entity, the second part is the second entity.

Specified by:
setObservations in interface RelationalProperty

getJacobianOfObservationConstraints

public Matrix getJacobianOfObservationConstraints()
Description copied from interface: RelationalProperty
Get the Jacobian of the constraint of the observation

Specified by:
getJacobianOfObservationConstraints in interface RelationalProperty
Returns:
Matrix G

getValueOfObservationConstraints

public Vector getValueOfObservationConstraints()
Description copied from interface: RelationalProperty
Get the value of the constraint of the observation

Specified by:
getValueOfObservationConstraints in interface RelationalProperty
Returns:
Matrix g0

getCovarianceOfObservations

public Matrix getCovarianceOfObservations()
The the covariance matrix of the observation of that relation. For trilinear observations this is the combinations for the covariance matrixes of the first and third entity. Used for estimation.

Specified by:
getCovarianceOfObservations in interface RelationalProperty
Returns:
the covariance of the observations.

getReducedCovarianceOfObservations

public Matrix getReducedCovarianceOfObservations()
The "reduced" covariance matrix of the observations which takes care of the homogeneous constraint. This is needed to obtain a coherent covariance of the corrected observation from the inner loop of the estimation, see note of WF from May 2005.

Specified by:
getReducedCovarianceOfObservations in interface RelationalProperty
Returns:
the covariance of the observations.

doCondition

public static double[] doCondition(RelationalProperty[] rprops)
Do conditioning of the observations.Two factors for all first entities and all second entities are returned.

Parameters:
rprops - a set of Tri(!)RelationalProperties. RelationalProperty is used for compatibility reasons.
Returns:
the 2 conditioning factors

doConditionOneFactor

public static double[] doConditionOneFactor(RelationalProperty[] rprops)
Do conditioning of the observations with one factor. Only one common factor for both sets of Entities is used. Used for estimation of Motion_3D.

Parameters:
rprops - a set of Tri(!)RelationalProperties. RelationalProperty is used for compatibility reasons.
Returns:
An array of two conditioning factors, which hold the same factor (for compatibility reasons)

doCondition

public static void doCondition(RelationalProperty[] rprops,
                               double[] f)
Do conditioning of the observations. The first entity is conditioned with f[0], the second with f[1].

Parameters:
f - the 2 conditioning factors
rprops - a set of Tri(!)RelationalProperties. RelationalProperty is used for compatibility reasons.

ChangeOrderVecTrans

private static Matrix ChangeOrderVecTrans(Matrix J)
Change the order of columns of a matrix in that way that the resulting matrix is J with J*vec(H) =0 whereas the input matrix is J*vec(Ht).

Parameters:
J - a matrix
Returns:
J with changed order of colums.

ensureConstraints

public void ensureConstraints()
Description copied from interface: RelationalProperty
Ensures, that all elements fulfill their constraints

Specified by:
ensureConstraints in interface RelationalProperty

changeNullspace

public void changeNullspace()
Description copied from interface: RelationalProperty
Changes the nullspace for all entities

Specified by:
changeNullspace in interface RelationalProperty