Class TemporalBroxOpticalFlow

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

    public class TemporalBroxOpticalFlow
    extends AlgorithmBase
    • Constructor Detail

      • TemporalBroxOpticalFlow

        public TemporalBroxOpticalFlow()
      • TemporalBroxOpticalFlow

        public TemporalBroxOpticalFlow​(ModelImage destuImg,
                                       ModelImage destvImg,
                                       ModelImage srcImg,
                                       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: AlgorithmBase
        Actually runs the algorithm. Implemented by inheriting algorithms.
        Specified by:
        runAlgorithm in class AlgorithmBase
      • gaussian

        public void gaussian​(double[] I,
                             int xdim,
                             int ydim,
                             double sigma,
                             int bc,
                             int precision)
        Convolution with a Gaussian
      • gaussian

        public void gaussian​(double[] in,
                             double[] out,
                             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

        public void gradient​(double[] input,
                             double[] dx,
                             double[] dy,
                             int nx,
                             int ny)
        Compute the gradient with central differences
      • gradient3

        public void gradient3​(double[] input,
                              double[] dx,
                              double[] dy,
                              double[] dz,
                              int nx,
                              int ny,
                              int nz)
        Compute the 3D gradient with central differences
      • psi_divergence

        public void psi_divergence​(double[] psi,
                                   double[] psi1,
                                   double[] psi2,
                                   double[] psi3,
                                   double[] psi4,
                                   double[] psi5,
                                   double[] psi6,
                                   int nx,
                                   int ny,
                                   int nz)
        Compute the coefficients of the divergence term
      • divergence_u

        public void divergence_u​(double[] u,
                                 double[] v,
                                 double[] psi1,
                                 double[] psi2,
                                 double[] psi3,
                                 double[] psi4,
                                 double[] psi5,
                                 double[] psi6,
                                 double[] div_u,
                                 double[] div_v,
                                 int nx,
                                 int ny,
                                 int nz)
        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 size)
        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 size)
        Compute the coefficients of the robust functional (gradient term)
      • psi_smooth

        public void psi_smooth​(double[] ux,
                               double[] uy,
                               double[] ut,
                               double[] vx,
                               double[] vy,
                               double[] vt,
                               double[] psi,
                               int size)
        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,
                                    double[] psi5,
                                    double[] psi6,
                                    int f,
                                    int df0,
                                    int df1,
                                    int i,
                                    int ny,
                                    int dy0,
                                    int dy1,
                                    int j,
                                    int nx,
                                    int dx0,
                                    int dx1)
        SOR iteration in one position
      • process_frame

        public double process_frame​(double[] Au,
                                    double[] Av,
                                    double[] Du,
                                    double[] Dv,
                                    double[] D,
                                    double[] du,
                                    double[] dv,
                                    double alpha,
                                    double[] psi1,
                                    double[] psi2,
                                    double[] psi3,
                                    double[] psi4,
                                    double[] psi5,
                                    double[] psi6,
                                    int f,
                                    int nx,
                                    int ny,
                                    int df0,
                                    int df1)
        Procedure to compute the motion increment in one frame
      • brox_optic_flow

        public void brox_optic_flow​(double[] I,
                                    double[] u,
                                    double[] v,
                                    int nx,
                                    int ny,
                                    int frames,
                                    double alpha,
                                    double gamma,
                                    double TOL,
                                    int inner_iter,
                                    int outer_iter,
                                    boolean verbose)
        Compute the optic flow with the Brox temporal method
      • getminmax

        public void getminmax​(double[] min,
                              double[] max,
                              double[] x,
                              int n)
        Compute the max and min of an array
      • image_normalization

        public void image_normalization​(double[] I,
                                        double[] In,
                                        int size)
        Function to normalize the images between 0 and 255
      • brox_optic_flow

        public void brox_optic_flow​(double[] I,
                                    double[] u,
                                    double[] v,
                                    int nxx,
                                    int nyy,
                                    int frames,
                                    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