motris.algorithm
Class OFAdaption

java.lang.Object
  extended bymotris.data.Description
      extended byparameter.ParameterizedObjectAdaptor
          extended bymotris.algorithm.Algorithm
              extended bymotris.algorithm.OFAdaption
All Implemented Interfaces:
MinimizationProblem, ParameterizedObject

public class OFAdaption
extends Algorithm
implements MinimizationProblem

Adapt 3D model on the basis of Optical Flow (OF) and expected displacement rate of its projection on the image plane

Author:
preuter

Nested Class Summary
 
Nested classes inherited from class parameter.ParameterizedObject
ParameterizedObject.ParameterChangedListener, ParameterizedObject.ParameterizedObjectManager
 
Field Summary
(package private)  Camera camera
           
(package private)  double chiSqrConfidenceLevel
           
(package private)  double chiSqrTestThreshold
           
(package private)  DisplacementRateDisplayLayer displacementdisplay
           
(package private)  OFImage displacementImage
           
(package private)  int framenum
           
(package private)  double measurementNoiseOF
           
(package private)  double minimumdisplacementratethreshold
           
(package private)  Actor myActor
           
(package private)  OpticalFlow ofCalculationAlgorithm
           
(package private)  OFImage ofImage
           
 
Fields inherited from class motris.algorithm.Algorithm
dataManager, experiment
 
Fields inherited from class parameter.ParameterizedObjectAdaptor
parameterChangedNotifyList
 
Fields inherited from class motris.data.Description
 
Constructor Summary
OFAdaption(Experiment _ex)
           
 
Method Summary
 double calculateResidual(DoubleMatrix apCovariance, DoubleVector Gradient, DoubleMatrix[] Hessian)
          Compute Residual, Gradient and Hessian Matrix of the Problem to be minimzed at the current position.
 void deregisterLayers()
          Remove all non-used Display layers
 OFImage getExpectedDisplacementImage()
           
 ParameterSet getParameters()
          Get a Vector of Strings with a description of each Parameter
 JSci.maths.DoubleSquareMatrix getPredictionMeasureCovariance(int matrixDimension)
           
 double getSecondaryResidual()
          compare these secondary residualsafter each scale and only accept the changes of that scale if the secondary residual decreased
 State getState()
           
 boolean isDisplacementBigEnough(DoubleVector stateVectorDelta)
           
 boolean setParameters(ParameterSet _params)
          Set Parameters of this class
 boolean setScale(int scale)
          Set Scale.
 
Methods inherited from class parameter.ParameterizedObjectAdaptor
addParameterChangedListener, finalize, fireParameterChanged, parameterEdited, removeParameterChangedListener
 
Methods inherited from class motris.data.Description
getDescription, getIdentifier, getName, setDescription, setIdentifier, setName
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myActor

Actor myActor

ofImage

OFImage ofImage

ofCalculationAlgorithm

OpticalFlow ofCalculationAlgorithm

displacementImage

OFImage displacementImage

framenum

int framenum

camera

Camera camera

displacementdisplay

DisplacementRateDisplayLayer displacementdisplay

minimumdisplacementratethreshold

double minimumdisplacementratethreshold

chiSqrConfidenceLevel

double chiSqrConfidenceLevel

chiSqrTestThreshold

double chiSqrTestThreshold

measurementNoiseOF

double measurementNoiseOF
Constructor Detail

OFAdaption

public OFAdaption(Experiment _ex)
Method Detail

calculateResidual

public double calculateResidual(DoubleMatrix apCovariance,
                                DoubleVector Gradient,
                                DoubleMatrix[] Hessian)
Description copied from interface: MinimizationProblem
Compute Residual, Gradient and Hessian Matrix of the Problem to be minimzed at the current position. In addition to the function arguments, the State x at which Lambda is to be evaluated (current position) has to be supplied as well. This is not included in the class signature because this supply is done by getState().setFromStateVector().

Specified by:
calculateResidual in interface MinimizationProblem
Parameters:
apCovariance - a-priori-State-Covariance P (input)
Gradient - Gradient of Lambda (result)
Hessian - 1-Dimension Vector with Hesse Matrix of Lambda (result). This needs to be an array s.t. java can _create_ a new Variable instead of just assigning values. For the EM Contour algorithm, the matrix can grow quite big so assigning is too slow.
Returns:
residual Lambda(x).

getParameters

public ParameterSet getParameters()
Description copied from interface: ParameterizedObject
Get a Vector of Strings with a description of each Parameter

Specified by:
getParameters in interface ParameterizedObject
Overrides:
getParameters in class ParameterizedObjectAdaptor

setParameters

public boolean setParameters(ParameterSet _params)
Description copied from interface: ParameterizedObject
Set Parameters of this class

Specified by:
setParameters in interface ParameterizedObject
Overrides:
setParameters in class ParameterizedObjectAdaptor

getExpectedDisplacementImage

public OFImage getExpectedDisplacementImage()

getState

public State getState()
Specified by:
getState in interface MinimizationProblem

deregisterLayers

public void deregisterLayers()
Description copied from class: Algorithm
Remove all non-used Display layers

Overrides:
deregisterLayers in class Algorithm

setScale

public boolean setScale(int scale)
Description copied from interface: MinimizationProblem
Set Scale. The scale is starting at 0 and increased as long as this function returns true.

Specified by:
setScale in interface MinimizationProblem
Parameters:
scale -

getSecondaryResidual

public double getSecondaryResidual()
Description copied from interface: MinimizationProblem
compare these secondary residualsafter each scale and only accept the changes of that scale if the secondary residual decreased

Specified by:
getSecondaryResidual in interface MinimizationProblem

isDisplacementBigEnough

public boolean isDisplacementBigEnough(DoubleVector stateVectorDelta)
Specified by:
isDisplacementBigEnough in interface MinimizationProblem

getPredictionMeasureCovariance

public JSci.maths.DoubleSquareMatrix getPredictionMeasureCovariance(int matrixDimension)
Specified by:
getPredictionMeasureCovariance in interface MinimizationProblem