@ALDDerivedClass @ALDParametrizedClass public class MTBSnakeEnergyCD_KassLength extends Object implements MTBSnakeEnergyDerivable, MTBSnakeEnergyComputable
The energy is based on first order derivatives of a snake C and is defined as follows:
In addition, the weighting parameters can dynamically be adjusted by
providing the energy with an update object, see
MTBSnakeEnergyCD_KassLength_ParamAdapt
.
Paper: Kass, Witkin and Terzopoulos, Snakes: Active Contour Models, International Journal of Computer Vision, pp. 321-331, 1988.
Modifier and Type | Field and Description |
---|---|
private double |
alphaInitial
Initial weighting factor for the length term, should be > 0.
|
private double[] |
alphas
Vector of point-specific alpha values.
|
private Double |
maxAlpha
Maximal possible value of alpha as can be provided by parameter updated.
|
private double |
normalizationFactor
Normalization factor for scaling matrix entries.
|
private SnakeOptimizerSingle.EnergyNormalizationMode |
normMode
Mode of normalization.
|
private MTBSnakeEnergyCD_KassLength_ParamAdapt |
pUpdater
Parameter update strategy.
|
protected double |
scaleFactor
Scaling factor for image coordinates.
|
targetEnergyRange
Constructor and Description |
---|
MTBSnakeEnergyCD_KassLength()
Default constructor.
|
MTBSnakeEnergyCD_KassLength(double _alpha,
MTBSnakeEnergyCD_KassLength_ParamAdapt _pUpd)
Constructor with dynamic parameter updater.
|
Modifier and Type | Method and Description |
---|---|
double |
calcEnergy(SnakeOptimizerSingle opt)
Calculates snake energy (non-normalized!).
|
double |
calcEnergy(SnakeOptimizerSingle opt,
int pos)
Calculates energy at a certain position for the current snake.
|
Jama.Matrix |
getDerivative_MatrixPart(SnakeOptimizerSingleVarCalc opt)
Updates matrix A given weights for the internal energy term.
|
Jama.Matrix |
getDerivative_VectorPart(SnakeOptimizerSingleVarCalc opt)
Returns the vector part of this energy for snake optimization.
|
double |
getInitAlpha()
Get the initial alpha value.
|
private double |
getNormalizationFactor(SnakeOptimizerSingle opt) |
double |
getScaleFactor()
Get scaling factor.
|
boolean |
initEnergy(SnakeOptimizerSingle o)
Init routine which is called once before the energy is actually used.
|
boolean |
requiresCounterClockwiseContourSorting()
Ask energy if contour points need to sorted counter-clockwise.
|
boolean |
requiresOverlapMask()
Ask energy if an overlap mask for all snakes jointly optimized is required.
|
void |
setScaleFactor(double s)
Set the scaling factor.
|
String |
toString()
Get an identifier string for the energy object.
|
void |
updateStatus(SnakeOptimizerSingle o)
Update internal state of energy object prior to usaging it.
|
@ALDClassParameter(label="Initial Alpha") private double alphaInitial
@ALDClassParameter(label="Parameter Updater") private MTBSnakeEnergyCD_KassLength_ParamAdapt pUpdater
private SnakeOptimizerSingle.EnergyNormalizationMode normMode
private double normalizationFactor
private Double maxAlpha
private double[] alphas
protected double scaleFactor
The factor is used to scale image coordinates between the range [0,1] and the real-world image size in pixels. Default scaling factor is 1.
public MTBSnakeEnergyCD_KassLength()
public MTBSnakeEnergyCD_KassLength(double _alpha, MTBSnakeEnergyCD_KassLength_ParamAdapt _pUpd)
_alpha
- Weighting factor for length term._pUpd
- Parameter update object.public void setScaleFactor(double s)
setScaleFactor
in interface MTBSnakeEnergyComputable
setScaleFactor
in interface MTBSnakeEnergyDerivable
s
- New scaling factor.public double getScaleFactor()
getScaleFactor
in interface MTBSnakeEnergyComputable
getScaleFactor
in interface MTBSnakeEnergyDerivable
public boolean initEnergy(SnakeOptimizerSingle o)
MTBSnakeEnergyDerivable
In this routine global parameter settings can be handled or other initialization stuff be done. The SnakeOptimizer will call this routine once before the actual use of the energy. If no stuff needs to be done in advance the routine should at least return true.
initEnergy
in interface MTBSnakeEnergyComputable
initEnergy
in interface MTBSnakeEnergyDerivable
o
- Calling snake optimizer.public double getInitAlpha()
public double calcEnergy(SnakeOptimizerSingle opt)
calcEnergy
in interface MTBSnakeEnergyComputable
opt
- Calling snake optimizer.public double calcEnergy(SnakeOptimizerSingle opt, int pos)
public Jama.Matrix getDerivative_MatrixPart(SnakeOptimizerSingleVarCalc opt)
The upper left block and the lower right block of matrix A just dependent on the weight parameters alpha and beta for the internal snake energy terms.
getDerivative_MatrixPart
in interface MTBSnakeEnergyDerivable
opt
- Calling snake optimizer.private double getNormalizationFactor(SnakeOptimizerSingle opt)
public Jama.Matrix getDerivative_VectorPart(SnakeOptimizerSingleVarCalc opt)
MTBSnakeEnergyDerivable
getDerivative_VectorPart
in interface MTBSnakeEnergyDerivable
opt
- Calling snake optimizer.public String toString()
MTBSnakeEnergyDerivable
When meta parameters are saved to a file, configuration objects need to be converted to strings. Consequently, each snake energy should be associated with a unique and descriptive string for later reference.
toString
in interface MTBSnakeEnergyComputable
toString
in interface MTBSnakeEnergyDerivable
toString
in class Object
public void updateStatus(SnakeOptimizerSingle o)
MTBSnakeEnergyDerivable
updateStatus
in interface MTBSnakeEnergyComputable
updateStatus
in interface MTBSnakeEnergyDerivable
public boolean requiresCounterClockwiseContourSorting()
MTBSnakeEnergyDerivable
requiresCounterClockwiseContourSorting
in interface MTBSnakeEnergyComputable
requiresCounterClockwiseContourSorting
in interface MTBSnakeEnergyDerivable
public boolean requiresOverlapMask()
MTBSnakeEnergyDerivable
requiresOverlapMask
in interface MTBSnakeEnergyComputable
requiresOverlapMask
in interface MTBSnakeEnergyDerivable
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.