Package gov.nih.mipav.model.algorithms
Class SpatialBroxOpticalFlow
- java.lang.Object
-
- java.lang.Thread
-
- gov.nih.mipav.model.algorithms.AlgorithmBase
-
- gov.nih.mipav.model.algorithms.SpatialBroxOpticalFlow
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.WindowListener,java.lang.Runnable,java.util.EventListener
public class SpatialBroxOpticalFlow extends AlgorithmBase
-
-
Field Summary
Fields Modifier and Type Field Description private doublealphaprivate ModelImagedestuImageprivate ModelImagedestvImageprivate doubleEPSILONprivate doublegammaprivate doubleGAUSSIAN_SIGMAprivate intiniterprivate intMAXITERprivate intnscalesprivate intoutiterprivate doublePAR_DEFAULT_ALPHAprivate doublePAR_DEFAULT_GAMMAprivate intPAR_DEFAULT_INNER_ITERprivate intPAR_DEFAULT_NSCALESprivate intPAR_DEFAULT_OUTER_ITERprivate doublePAR_DEFAULT_TOLprivate booleanPAR_DEFAULT_VERBOSEprivate doublePAR_DEFAULT_ZFACTORprivate doubleSOR_PARAMETERprivate ModelImagesrcImage1private ModelImagesrcImage2private doubleTOL(package private) TVL1FLOWtvl1private booleanverboseprivate doublezfactor-
Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStopped
-
-
Constructor Summary
Constructors Constructor Description SpatialBroxOpticalFlow()SpatialBroxOpticalFlow(ModelImage destuImg, ModelImage destvImg, ModelImage srcImg1, ModelImage srcImg2, double alpha, double gamma, int nscales, double zfactor, double TOL, int inner_iter, int outer_iter, boolean verbose)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbrox_optic_flow(double[] I1, double[] I2, double[] u, double[] v, int nx, int ny, double alpha, double gamma, double TOL, int inner_iter, int outer_iter, boolean verbose)Compute the optic flow with the Brox spatial methodvoidbrox_optic_flow(double[] I1, double[] I2, double[] u, double[] v, int nxx, int nyy, double alpha, double gamma, int nscales, double nu, double TOL, int inner_iter, int outer_iter, boolean verbose)Multiscale approach for computing the optical flow(package private) voiddivergence_u(double[] u, double[] v, double[] psi1, double[] psi2, double[] psi3, double[] psi4, double[] div_u, double[] div_v, int nx, int ny)Compute the divergence of the optical flowvoidDxx(double[] I, double[] Ixx, int nx, int ny)Compute the second order X derivativevoidDxy(double[] I, double[] Ixy, int nx, int ny)Compute the second order XY derivativevoidDyy(double[] I, double[] Iyy, int nx, int ny)Compute the second order Y derivativevoidgaussian(double[] in, double[] out, int xdim, int ydim, double sigma, int bc, int precision)Convolution with a Gaussianvoidgaussian(double[] I, int xdim, int ydim, double sigma, int bc, int precision)Convolution with a Gaussian(package private) voidgradient(double[] input, double[] dx, double[] dy, int nx, int ny)Compute the gradient with central differencesvoidmask3x3(double[] input, double[] output, int nx, int ny, double[] mask)Function to apply a 3x3 mask to an imagevoidpsi_data(double[] I1, double[] I2, double[] I2x, double[] I2y, double[] du, double[] dv, double[] psip, int nx, int ny)Compute the coefficients of the robust functional (data term)(package private) voidpsi_divergence(double[] psi, double[] psi1, double[] psi2, double[] psi3, double[] psi4, int nx, int ny)Compute the coefficients of the divergence termvoidpsi_gradient(double[] I1x, double[] I1y, double[] I2x, double[] I2y, double[] I2xx, double[] I2xy, double[] I2yy, double[] du, double[] dv, double[] psip, int nx, int ny)Compute the coefficients of the robust functional (gradient term)voidpsi_smooth(double[] ux, double[] uy, double[] vx, double[] vy, double[] psi, int nx, int ny)Compute the coefficients of the robust functional (smoothness term)voidrunAlgorithm()Actually runs the algorithm.doublesor_iteration(double[] Au, double[] Av, double[] Du, double[] Dv, double[] D, double[] du, double[] dv, double alpha, double[] psi1, double[] psi2, double[] psi3, double[] psi4, int i, int i0, int i1, int j, int nx, int j0, int j1)SOR iteration in one position-
Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, finalize, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Field Detail
-
tvl1
TVL1FLOW tvl1
-
EPSILON
private final double EPSILON
- See Also:
- Constant Field Values
-
MAXITER
private final int MAXITER
- See Also:
- Constant Field Values
-
SOR_PARAMETER
private final double SOR_PARAMETER
- See Also:
- Constant Field Values
-
GAUSSIAN_SIGMA
private final double GAUSSIAN_SIGMA
- See Also:
- Constant Field Values
-
PAR_DEFAULT_ALPHA
private final double PAR_DEFAULT_ALPHA
- See Also:
- Constant Field Values
-
PAR_DEFAULT_GAMMA
private final double PAR_DEFAULT_GAMMA
- See Also:
- Constant Field Values
-
PAR_DEFAULT_NSCALES
private final int PAR_DEFAULT_NSCALES
- See Also:
- Constant Field Values
-
PAR_DEFAULT_ZFACTOR
private final double PAR_DEFAULT_ZFACTOR
- See Also:
- Constant Field Values
-
PAR_DEFAULT_TOL
private final double PAR_DEFAULT_TOL
- See Also:
- Constant Field Values
-
PAR_DEFAULT_INNER_ITER
private final int PAR_DEFAULT_INNER_ITER
- See Also:
- Constant Field Values
-
PAR_DEFAULT_OUTER_ITER
private final int PAR_DEFAULT_OUTER_ITER
- See Also:
- Constant Field Values
-
PAR_DEFAULT_VERBOSE
private final boolean PAR_DEFAULT_VERBOSE
- See Also:
- Constant Field Values
-
srcImage1
private ModelImage srcImage1
-
srcImage2
private ModelImage srcImage2
-
destuImage
private ModelImage destuImage
-
destvImage
private ModelImage destvImage
-
alpha
private double alpha
-
gamma
private double gamma
-
nscales
private int nscales
-
zfactor
private double zfactor
-
TOL
private double TOL
-
initer
private int initer
-
outiter
private int outiter
-
verbose
private boolean verbose
-
-
Constructor Detail
-
SpatialBroxOpticalFlow
public SpatialBroxOpticalFlow()
-
SpatialBroxOpticalFlow
public SpatialBroxOpticalFlow(ModelImage destuImg, ModelImage destvImg, ModelImage srcImg1, ModelImage srcImg2, double alpha, double gamma, int nscales, double zfactor, double TOL, int inner_iter, int outer_iter, boolean verbose)
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm()
Description copied from class:AlgorithmBaseActually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithmin classAlgorithmBase
-
gaussian
public void gaussian(double[] in, double[] out, int xdim, int ydim, double sigma, int bc, int precision)Convolution with a Gaussian
-
gaussian
public void gaussian(double[] I, int xdim, int ydim, double sigma, int bc, int precision)Convolution with a Gaussian
-
mask3x3
public void mask3x3(double[] input, double[] output, int nx, int ny, double[] mask)Function to apply a 3x3 mask to an image
-
Dxx
public void Dxx(double[] I, double[] Ixx, int nx, int ny)Compute the second order X derivative
-
Dyy
public void Dyy(double[] I, double[] Iyy, int nx, int ny)Compute the second order Y derivative
-
Dxy
public void Dxy(double[] I, double[] Ixy, int nx, int ny)Compute the second order XY derivative
-
gradient
void gradient(double[] input, double[] dx, double[] dy, int nx, int ny)Compute the gradient with central differences
-
psi_divergence
void psi_divergence(double[] psi, double[] psi1, double[] psi2, double[] psi3, double[] psi4, int nx, int ny)Compute the coefficients of the divergence term
-
divergence_u
void divergence_u(double[] u, double[] v, double[] psi1, double[] psi2, double[] psi3, double[] psi4, double[] div_u, double[] div_v, int nx, int ny)Compute the divergence of the optical flow
-
psi_data
public void psi_data(double[] I1, double[] I2, double[] I2x, double[] I2y, double[] du, double[] dv, double[] psip, int nx, int ny)Compute the coefficients of the robust functional (data term)
-
psi_gradient
public void psi_gradient(double[] I1x, double[] I1y, double[] I2x, double[] I2y, double[] I2xx, double[] I2xy, double[] I2yy, double[] du, double[] dv, double[] psip, int nx, int ny)Compute the coefficients of the robust functional (gradient term)
-
psi_smooth
public void psi_smooth(double[] ux, double[] uy, double[] vx, double[] vy, double[] psi, int nx, int ny)Compute the coefficients of the robust functional (smoothness term)
-
sor_iteration
public double sor_iteration(double[] Au, double[] Av, double[] Du, double[] Dv, double[] D, double[] du, double[] dv, double alpha, double[] psi1, double[] psi2, double[] psi3, double[] psi4, int i, int i0, int i1, int j, int nx, int j0, int j1)SOR iteration in one position
-
brox_optic_flow
public void brox_optic_flow(double[] I1, double[] I2, double[] u, double[] v, int nx, int ny, double alpha, double gamma, double TOL, int inner_iter, int outer_iter, boolean verbose)Compute the optic flow with the Brox spatial method
-
brox_optic_flow
public void brox_optic_flow(double[] I1, double[] I2, double[] u, double[] v, int nxx, int nyy, double alpha, double gamma, int nscales, double nu, double TOL, int inner_iter, int outer_iter, boolean verbose)Multiscale approach for computing the optical flow
-
-