motris.algorithm.emcontour
Class EMContourMinimizer

java.lang.Object
  extended bymotris.data.Description
      extended byparameter.ParameterizedObjectAdaptor
          extended bymotris.algorithm.Algorithm
              extended bymotris.algorithm.emcontour.EMContourMinimizer
All Implemented Interfaces:
ImageSequenceData.TimeChangedListener, MinimizationProblem, ParameterizedObject, ParameterizedObject.ParameterChangedListener, SceneDescription.ActorListChangedListener

public class EMContourMinimizer
extends Algorithm
implements MinimizationProblem, ParameterizedObject.ParameterChangedListener, SceneDescription.ActorListChangedListener, ImageSequenceData.TimeChangedListener

Implementation of the EM Contour Algorithm first introduced by Arthur E.C. Pece in Tracking without Feature Detection, Proceedings of the 1st IEEE Workshop on Performance Evaluation of Tracking and Surveillance (PETS2000), 31st March 2000, Grenoble, France.

Author:
dahlkamp

Nested Class Summary
 
Nested classes inherited from class parameter.ParameterizedObject
ParameterizedObject.ParameterChangedListener, ParameterizedObject.ParameterizedObjectManager
 
Field Summary
(package private)  Actor actor
           
(package private)  boolean adjustMeasurePointsPerSide
           
(package private)  boolean adjustMSPWeightIfIntersect
           
(package private)  GrayValueGaussianDistribution aPrioriKEPosDist
           
(package private)  Camera cam
           
(package private)  boolean computeStartingSigma
           
(package private)  double currentSigmaNuScene
           
(package private)  State currentState
           
private  boolean DEBUGMODE
           
(package private)  double distanceMuImage
           
(package private)  double distanceNuFactor
           
(package private)  GrayValueDistribution[] distri
           
(package private)  int[] distriIndex
           
 java.lang.String[] distriNames
           
(package private)  double globalProjectedSigma
           
(package private)  GrayImage image
           
(package private)  int imageNum
           
(package private)  int kalmanMeasurement
           
(package private)  double maxClipStartingSigma
           
(package private)  int maxMeasurePointsPerSide
           
(package private)  double maxMeasurePointsPerSideAsProductOfSigma
           
(package private)  double minClipStartingSigma
           
(package private)  double minimumScale
           
(package private)  int minMeasurePointsPerSide
           
 ModelSegmentPointList modelSegmentPointList
           
(package private)  boolean normalizeResidual
           
(package private)  boolean normalizeSecondaryResidual
           
(package private)  boolean recomputeLambda
           
private  java.util.Vector scaleScaleHistory
           
private  java.util.Vector scaleTimeHistory
           
(package private)  SceneDescription scene
           
(package private)  double sigmaNuDecreaseFactor
           
(package private)  double startingSigmaNuScene
           
(package private)  boolean useActorVisibleAt
           
(package private)  boolean useGlobalProjectedSigma
           
(package private)  boolean useSecondaryResidual
           
 
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
EMContourMinimizer(Experiment _experiment)
           
 
Method Summary
 void actorListChanged(java.util.Vector actorList)
           
 double calculateResidual(DoubleMatrix apCovariance, DoubleVector Gradient, DoubleMatrix[] Hessian)
          Compute Residual, Gradient and Hessian Matrix of the Problem to be minimzed at the current position.
(package private)  void computeLambda()
          Compute the normalization coefficient lambda for the GrayValueDistributions and propagate it to them.
protected  double computeProjectedDistance(double distance, DoubleVector start, ImageEdge onImageEdge)
           
 void deregisterLayers()
          Remove all non-used Display layers
 ParameterSet getParameters()
          Get a Vector of Strings with a description of each Parameter
 JSci.maths.DoubleSquareMatrix getPredictionMeasureCovariance(int matrixDimension)
           
 double getSecondaryResidual()
          Secondary residual for EM Contour algorithm is the log-likelihood at scale minimumScale
 State getState()
           
 boolean isDisplacementBigEnough(DoubleVector stateVectorDelta)
           
 void parameterChanged(ParameterizedObject source)
           
 DoubleVector plotSecondaryResidualByDirection()
           
 DoubleMatrix plotSecondaryResidualByPosition()
           
private  void setDistribution(ParameterSet _params)
           
 boolean setParameters(ParameterSet _params)
          Set Parameters of this class
 boolean setScale(int scale)
          Set Scale.
 void timeChanged(int previousTime, int newTime)
           
 
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

DEBUGMODE

private boolean DEBUGMODE

modelSegmentPointList

public ModelSegmentPointList modelSegmentPointList

distri

GrayValueDistribution[] distri

distriIndex

int[] distriIndex

distriNames

public final java.lang.String[] distriNames

currentState

State currentState

actor

Actor actor

cam

Camera cam

image

GrayImage image

scene

SceneDescription scene

currentSigmaNuScene

double currentSigmaNuScene

startingSigmaNuScene

double startingSigmaNuScene

distanceNuFactor

double distanceNuFactor

distanceMuImage

double distanceMuImage

computeStartingSigma

boolean computeStartingSigma

useSecondaryResidual

boolean useSecondaryResidual

normalizeResidual

boolean normalizeResidual

normalizeSecondaryResidual

boolean normalizeSecondaryResidual

maxClipStartingSigma

double maxClipStartingSigma

minClipStartingSigma

double minClipStartingSigma

maxMeasurePointsPerSide

int maxMeasurePointsPerSide

minMeasurePointsPerSide

int minMeasurePointsPerSide

adjustMeasurePointsPerSide

boolean adjustMeasurePointsPerSide

adjustMSPWeightIfIntersect

boolean adjustMSPWeightIfIntersect

kalmanMeasurement

int kalmanMeasurement

imageNum

int imageNum

minimumScale

double minimumScale

sigmaNuDecreaseFactor

double sigmaNuDecreaseFactor

recomputeLambda

boolean recomputeLambda

useActorVisibleAt

boolean useActorVisibleAt

useGlobalProjectedSigma

boolean useGlobalProjectedSigma

globalProjectedSigma

double globalProjectedSigma

maxMeasurePointsPerSideAsProductOfSigma

double maxMeasurePointsPerSideAsProductOfSigma

aPrioriKEPosDist

GrayValueGaussianDistribution aPrioriKEPosDist

scaleScaleHistory

private java.util.Vector scaleScaleHistory

scaleTimeHistory

private java.util.Vector scaleTimeHistory
Constructor Detail

EMContourMinimizer

public EMContourMinimizer(Experiment _experiment)
Method Detail

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

computeLambda

void computeLambda()
Compute the normalization coefficient lambda for the GrayValueDistributions and propagate it to them.


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

setDistribution

private void setDistribution(ParameterSet _params)

computeProjectedDistance

protected double computeProjectedDistance(double distance,
                                          DoubleVector start,
                                          ImageEdge onImageEdge)

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

getSecondaryResidual

public double getSecondaryResidual()
Secondary residual for EM Contour algorithm is the log-likelihood at scale minimumScale

Specified by:
getSecondaryResidual in interface MinimizationProblem

parameterChanged

public void parameterChanged(ParameterizedObject source)
Specified by:
parameterChanged in interface ParameterizedObject.ParameterChangedListener

actorListChanged

public void actorListChanged(java.util.Vector actorList)
Specified by:
actorListChanged in interface SceneDescription.ActorListChangedListener

deregisterLayers

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

Overrides:
deregisterLayers in class Algorithm

timeChanged

public void timeChanged(int previousTime,
                        int newTime)
Specified by:
timeChanged in interface ImageSequenceData.TimeChangedListener

getState

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

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 -

isDisplacementBigEnough

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

plotSecondaryResidualByPosition

public DoubleMatrix plotSecondaryResidualByPosition()

plotSecondaryResidualByDirection

public DoubleVector plotSecondaryResidualByDirection()

getPredictionMeasureCovariance

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