public class VectorField2DPotentialFinder extends Object
MTBVectorField2D
Modifier and Type | Class and Description |
---|---|
protected class |
VectorField2DPotentialFinder.PotentialFinderOptFunction
Optimization function for gradient-based potential reconstruction.
|
Modifier and Type | Field and Description |
---|---|
protected MTBVectorField2D |
field
Vector field the potential is reconstructed for.
|
Constructor and Description |
---|
VectorField2DPotentialFinder()
Standard constructor.
|
VectorField2DPotentialFinder(MTBVectorField2D f)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
double[] |
calcPotential_exactLeastSquares(boolean ignoreBorder)
Exact least squares reconstruction of the potential.
|
double[] |
calcPotential_gradientDescent(boolean ignoreBorder)
Reconstruct potential via gradient descent.
|
double[] |
calcPotential_incrementalLeastSquares(boolean ignoreBorder)
Reconstructs the potential of the vector field incrementally.
|
private void |
normalizePotentialToMin(double[] pot,
boolean ignoreBorder)
Function to normalize a potential to the minimum value of 0.
|
protected MTBVectorField2D field
public VectorField2DPotentialFinder()
public VectorField2DPotentialFinder(MTBVectorField2D f)
f
- Vector field.public double[] calcPotential_exactLeastSquares(boolean ignoreBorder)
Attention!!! This function takes a lot of memory! Never use it with fields larger than approx. 30 x 30 pixels!!!
The function reconstructs the potential by solving a linear system of equations via explicit LQ-decomposition. The linear system contains a lot of rows and columns:
ignoreBorder
- If true, first/last column/row of U and V will be ignored.public double[] calcPotential_gradientDescent(boolean ignoreBorder)
ignoreBorder
- If true, border pixels are ignored in reconstruction.public double[] calcPotential_incrementalLeastSquares(boolean ignoreBorder)
Starting with last entry field bottom right in the vector field the potential is reconstructed incrementally by least square solutions of the two given constraint equations for each image pixel. The solution is only approximative as no global optimization criterion is considered. Nevertheless, it might be used as initialization for the gradient descent routines, if it is not of direct interest.
ignoreBorder
- If true, first/last row/column of U and V are ignored.private void normalizePotentialToMin(double[] pot, boolean ignoreBorder)
pot
- Potential field to normalize.ignoreBorder
- If true outer rows and cols are ignored.Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.