Class TVL1FLOW

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

    public class TVL1FLOW
    extends AlgorithmBase
    • Constructor Detail

      • TVL1FLOW

        public TVL1FLOW()
      • TVL1FLOW

        public TVL1FLOW​(ModelImage destuImg,
                        ModelImage destvImg,
                        ModelImage srcImg1,
                        ModelImage srcImg2,
                        double tau,
                        double lambda,
                        double theta,
                        int nscales,
                        double zfactor,
                        int nwarps,
                        double epsilon,
                        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
      • hypot

        private double hypot​(double x,
                             double y)
      • neumann_bc

        public int neumann_bc​(int x,
                              int nx,
                              boolean[] out)
        Neumann boundary condition test
      • periodic_bc

        public int periodic_bc​(int x,
                               int nx,
                               boolean[] out)
        Periodic boundary condition test
      • symmetric_bc

        public int symmetric_bc​(int x,
                                int nx,
                                boolean[] out)
        Symmetric boundary condition test
      • cubic_interpolation_cell

        public double cubic_interpolation_cell​(double[] v,
                                               double x)
        Cubic interpolation in one dimension
      • bicubic_interpolation_cell

        public double bicubic_interpolation_cell​(double[][] p,
                                                 double x,
                                                 double y)
        Bicubic interpolation in two dimensions
      • bicubic_interpolation_at

        public double bicubic_interpolation_at​(double[] input,
                                               double uu,
                                               double vv,
                                               int nx,
                                               int ny,
                                               boolean border_out)
        Compute the bicubic interpolation of a point in an image. Detect if the point goes outside the image domain.
      • bicubic_interpolation_warp

        public void bicubic_interpolation_warp​(double[] input,
                                               double[] u,
                                               double[] v,
                                               double[] output,
                                               int nx,
                                               int ny,
                                               boolean border_out)
        Compute the bicubic interpolation of an image.
      • divergence

        public void divergence​(double[] v1,
                               double[] v2,
                               double[] div,
                               int nx,
                               int ny)
        Function to compute the divergence with backward differences (see [2] for details)
      • forward_gradient

        public void forward_gradient​(double[] f,
                                     double[] fx,
                                     double[] fy,
                                     int nx,
                                     int ny)
        Function to compute the gradient with forward differences (see [2] for details)
      • centered_gradient

        public void centered_gradient​(double[] input,
                                      double[] dx,
                                      double[] dy,
                                      int nx,
                                      int ny)
        Function to compute the gradient with centered differences
      • gaussian

        public void gaussian​(double[] I,
                             int xdim,
                             int ydim,
                             double sigma)
        In-place Gaussian smoothing of an image
      • zoom_size

        public void zoom_size​(int nx,
                              int ny,
                              int[] nxx,
                              int[] nyy,
                              double factor)
        Compute the size of a zoomed image from the zoom factor
      • zoom_out

        public void zoom_out​(double[] I,
                             double[] Iout,
                             int nx,
                             int ny,
                             double factor)
        Downsample an image
      • zoom_in

        public void zoom_in​(double[] I,
                            double[] Iout,
                            int nx,
                            int ny,
                            int nxx,
                            int nyy)
        Function to upsample the image
      • Dual_TVL1_optic_flow

        public void Dual_TVL1_optic_flow​(double[] I0,
                                         double[] I1,
                                         double[] u1,
                                         double[] u2,
                                         int nx,
                                         int ny,
                                         double tau,
                                         double lambda,
                                         double theta,
                                         int warps,
                                         double epsilon,
                                         boolean verbose)
        Function to compute the optical flow in one scale
      • 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[] I0,
                                        double[] I1,
                                        double[] I0n,
                                        double[] I1n,
                                        int size)
        Function to normalize the images between 0 and 255
      • Dual_TVL1_optic_flow_multiscale

        public void Dual_TVL1_optic_flow_multiscale​(double[] I0,
                                                    double[] I1,
                                                    double[] u1,
                                                    double[] u2,
                                                    int nxx,
                                                    int nyy,
                                                    double tau,
                                                    double lambda,
                                                    double theta,
                                                    int nscales,
                                                    double zfactor,
                                                    int warps,
                                                    double epsilon,
                                                    boolean verbose)
        Function to compute the optical flow using multiple scales