Class BroxWarpingSpacial<T extends ImageGray<T>>


public class BroxWarpingSpacial<T extends ImageGray<T>> extends DenseFlowPyramidBase<T>

Dense optical flow which adheres to a brightness constancy assumption, a gradient constancy assumption, and a discontinuity-preserving spatio-temporal smoothness constraint. Based on the work of Brox [2] with implementation details taken from [1].

  1. Javier Sánchez Pérez, Nelson Monzón López, and Agustín Salgado de la Nuez, Robust Optical Flow Estimation, Image Processing On Line, 3 (2013), pp. 252–270.
  2. Thomas Brox, Andr´es Bruhn, Nils Papenberg, and Joachim Weickert. High accuracy optical flow estimation based on a theory for warping. In T. Pajdla and J. Matas, editors, European Conference on Computer Vision (ECCV), volume 3024 of Lecture Notes in Computer Science, pages 25–36, Prague, Czech Republic, May 2004. Springer.
  • Field Details

    • alpha

      protected float alpha
    • gamma

      protected float gamma
    • flowU

      protected GrayF32 flowU
    • flowV

      protected GrayF32 flowV
    • warpImage2

      protected GrayF32 warpImage2
    • warpDeriv2X

      protected GrayF32 warpDeriv2X
    • warpDeriv2Y

      protected GrayF32 warpDeriv2Y
    • warpDeriv2XX

      protected GrayF32 warpDeriv2XX
    • warpDeriv2YY

      protected GrayF32 warpDeriv2YY
    • warpDeriv2XY

      protected GrayF32 warpDeriv2XY
    • derivFlowUX

      protected GrayF32 derivFlowUX
    • derivFlowUY

      protected GrayF32 derivFlowUY
    • derivFlowVX

      protected GrayF32 derivFlowVX
    • derivFlowVY

      protected GrayF32 derivFlowVY
    • psiSmooth

      protected GrayF32 psiSmooth
    • psiData

      protected GrayF32 psiData
    • psiGradient

      protected GrayF32 psiGradient
    • divU

      protected GrayF32 divU
    • divV

      protected GrayF32 divV
    • divD

      protected GrayF32 divD
    • du

      protected GrayF32 du
    • dv

      protected GrayF32 dv
  • Constructor Details

    • BroxWarpingSpacial

      public BroxWarpingSpacial(ConfigBroxWarping config, InterpolatePixelS<GrayF32> interp)
      Configures flow estimation
      config - Configuration parameters
      interp - Interpolation for image flow between image layers and warping. Overrides selection in config.
  • Method Details

    • process

      public void process(ImagePyramid<GrayF32> image1, ImagePyramid<GrayF32> image2)
      Computes dense optical flow from the provided image pyramid. Image gradient for each layer should be computed directly from the layer images.
      Specified by:
      process in class DenseFlowPyramidBase<T extends ImageGray<T>>
      image1 - Pyramid of first image
      image2 - Pyramid of second image
    • resizeForLayer

      protected void resizeForLayer(int width, int height)
      Resize images for the current layer being processed
    • interpolateFlowScale

      protected void interpolateFlowScale(int widthNew, int heightNew)
      Provides an initial estimate for the flow by interpolating values from the previous layer.
    • processLayer

      protected void processLayer(GrayF32 image1, GrayF32 image2, GrayF32 deriv1X, GrayF32 deriv1Y, GrayF32 deriv2X, GrayF32 deriv2Y, GrayF32 deriv2XX, GrayF32 deriv2YY, GrayF32 deriv2XY)
      Computes the flow for a layer using Taylor series expansion and Successive Over-Relaxation linear solver. Flow estimates from previous layers are feed into this by setting initFlow and flow to their values.
    • computePsiDataPsiGradient

      protected void computePsiDataPsiGradient(GrayF32 image1, GrayF32 image2, GrayF32 deriv1x, GrayF32 deriv1y, GrayF32 deriv2x, GrayF32 deriv2y, GrayF32 deriv2xx, GrayF32 deriv2yy, GrayF32 deriv2xy, GrayF32 du, GrayF32 dv, GrayF32 psiData, GrayF32 psiGradient)
      Compute Psi-data using equation 6 and approximation in equation 5
    • computeDivUVD_safe

      protected void computeDivUVD_safe(int x, int y, GrayF32 u, GrayF32 v, GrayF32 psi, GrayF32 divU, GrayF32 divV, GrayF32 divD)
    • s

      protected int s(int x, int y)
    • getFlowX

      public GrayF32 getFlowX()
    • getFlowY

      public GrayF32 getFlowY()