Package gov.nih.mipav.model.algorithms
Class HornSchunk
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.HornSchunk
- All Implemented Interfaces:
ActionListener,WindowListener,Runnable,EventListener
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate double(package private) intprivate ModelImageprivate ModelImageprivate final doubleprivate int(package private) final int(package private) final intprivate intprivate int(package private) final double(package private) final int(package private) final int(package private) final int(package private) final double(package private) final boolean(package private) final double(package private) final double(package private) final int(package private) final intprivate final doubleprivate ModelImageprivate ModelImage(package private) final intprivate double(package private) TVL1FLOWprivate booleanprivate intprivate doubleFields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionHornSchunk(ModelImage destuImg, ModelImage destvImg, ModelImage srcImg1, ModelImage srcImg2, double alpha, int nscales, double zfactor, int warps, double TOL, int maxiter, boolean verbose) HornSchunk(ModelImage destuImg, ModelImage destvImg, ModelImage srcImg1, ModelImage srcImg2, int niter, double alpha) -
Method Summary
Modifier and TypeMethodDescriptionvoidcompute_bar(double[] ubar, double[] u, int w, int h) voidcompute_input_derivatives(double[] Ex, double[] Ey, double[] Et, double[] a, double[] b, int w, int h) (package private) voidgradient(double[] input, double[] dx, double[] dy, int nx, int ny) Compute the gradient of an image using centered differences(package private) voidhorn_schunck_optical_flow(double[] I1, double[] I2, double[] u, double[] v, int nx, int ny, double alpha, int warps, double TOL, int maxiter, boolean verbose) Horn invalid input: '&' Schunck method for optical flow estimation at a single scale(package private) voidhorn_schunck_pyramidal(double[] I1, double[] I2, double[] u, double[] v, int nx, int ny, double alpha, int nscales, double zfactor, int warps, double TOL, int maxiter, boolean verbose) Procedure to handle the pyramidal approach.voidhs(double[] u, double[] v, double[] a, double[] b, int w, int h, int n, double alpha) voidhs_iteration(double[] u, double[] v, double[] Ex, double[] Ey, double[] Et, int w, int h, double alpha) private doublehypot(double x, double y) doublep(double[] x, int w, int h, int i, int j) voidActually runs the algorithm.doublesor_iteration(double[] Au, double[] Av, double[] Du, double[] Dv, double[] D, double[] u, double[] v, double al, int p, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) Function to compute the SOR iteration at a given position (SOR = Successive Over-Relaxation)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, windowOpenedMethods 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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
Neumann
final int Neumann- See Also:
-
Periodic
final int Periodic- See Also:
-
Symmetric
final int Symmetric- See Also:
-
BOUNDARY_CONDITION
int BOUNDARY_CONDITION -
tvl1
TVL1FLOW tvl1 -
SINGLE_SCALE
final int SINGLE_SCALE- See Also:
-
MULTI_SCALE
final int MULTI_SCALE- See Also:
-
algorithmType
private int algorithmType -
srcImage1
-
srcImage2
-
destuImage
-
destvImage
-
niter
private int niter -
alpha
private double alpha -
nscales
private int nscales -
zfactor
private double zfactor -
warps
private int warps -
TOL
private double TOL -
verbose
private boolean verbose -
maxiter
private int maxiter -
PAR_DEFAULT_ALPHA
final double PAR_DEFAULT_ALPHA- See Also:
-
PAR_DEFAULT_NSCALES
final int PAR_DEFAULT_NSCALES- See Also:
-
PAR_DEFAULT_ZFACTOR
final double PAR_DEFAULT_ZFACTOR- See Also:
-
PAR_DEFAULT_NWARPS
final int PAR_DEFAULT_NWARPS- See Also:
-
PAR_DEFAULT_TOL
final double PAR_DEFAULT_TOL- See Also:
-
PAR_DEFAULT_MAXITER
final int PAR_DEFAULT_MAXITER- See Also:
-
PAR_DEFAULT_VERBOSE
final boolean PAR_DEFAULT_VERBOSE- See Also:
-
PAR_MAX_ZFACTOR
final double PAR_MAX_ZFACTOR- See Also:
-
SOR_EXTRAPOLATION_PARAMETER
private final double SOR_EXTRAPOLATION_PARAMETER- See Also:
-
INPUT_PRESMOOTHING_SIGMA
private final double INPUT_PRESMOOTHING_SIGMA- See Also:
-
-
Constructor Details
-
HornSchunk
public HornSchunk(ModelImage destuImg, ModelImage destvImg, ModelImage srcImg1, ModelImage srcImg2, int niter, double alpha) -
HornSchunk
public HornSchunk(ModelImage destuImg, ModelImage destvImg, ModelImage srcImg1, ModelImage srcImg2, double alpha, int nscales, double zfactor, int warps, double TOL, int maxiter, boolean verbose)
-
-
Method Details
-
runAlgorithm
public void runAlgorithm()Description copied from class:AlgorithmBaseActually runs the algorithm. Implemented by inheriting algorithms.- Specified by:
runAlgorithmin classAlgorithmBase
-
hypot
private double hypot(double x, double y) -
horn_schunck_pyramidal
void horn_schunck_pyramidal(double[] I1, double[] I2, double[] u, double[] v, int nx, int ny, double alpha, int nscales, double zfactor, int warps, double TOL, int maxiter, boolean verbose) Procedure to handle the pyramidal approach. This procedure relies on the previous functions to calculate large optical flow fields using a pyramidal scheme. -
horn_schunck_optical_flow
void horn_schunck_optical_flow(double[] I1, double[] I2, double[] u, double[] v, int nx, int ny, double alpha, int warps, double TOL, int maxiter, boolean verbose) Horn invalid input: '&' Schunck method for optical flow estimation at a single scale -
gradient
void gradient(double[] input, double[] dx, double[] dy, int nx, int ny) Compute the gradient of an image using centered differences -
sor_iteration
public double sor_iteration(double[] Au, double[] Av, double[] Du, double[] Dv, double[] D, double[] u, double[] v, double al, int p, int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8) Function to compute the SOR iteration at a given position (SOR = Successive Over-Relaxation) -
p
public double p(double[] x, int w, int h, int i, int j) -
compute_input_derivatives
public void compute_input_derivatives(double[] Ex, double[] Ey, double[] Et, double[] a, double[] b, int w, int h) -
compute_bar
public void compute_bar(double[] ubar, double[] u, int w, int h) -
hs_iteration
public void hs_iteration(double[] u, double[] v, double[] Ex, double[] Ey, double[] Et, int w, int h, double alpha) -
hs
public void hs(double[] u, double[] v, double[] a, double[] b, int w, int h, int n, double alpha)
-