Package boofcv.alg.flow
Class HornSchunckPyramid<T extends ImageGray<T>>
java.lang.Object
boofcv.alg.flow.DenseFlowPyramidBase<T>
boofcv.alg.flow.HornSchunckPyramid<T>
Pyramidal implementation of Horn-Schunck [2] based on the discussion in [1]. The problem formulation has been modified from the original found in [2] to account for larger displacements. The Euler-Lagrange equations are solved using Successive Over-Relaxation (SOR).
- Meinhardt-Llopis, Enric and Sánchez Pérez, Javier and Kondermann, Daniel, "Horn-Schunck Optical Flow with a Multi-Scale Strategy" vol 3, 2013, Image Processing On Line
- Horn, Berthold K., and Brian G. Schunck. "Determining optical flow." 1981 Technical Symposium East. International Society for Optics and Photonics, 1981.
-
Field Summary
Modifier and TypeFieldDescriptionprotected GrayF32
protected GrayF32
protected GrayF32
protected GrayF32
protected GrayF32
protected GrayF32
protected GrayF32
Fields inherited from class boofcv.alg.flow.DenseFlowPyramidBase
interp, pyr1, pyr2
-
Constructor Summary
ConstructorDescriptionHornSchunckPyramid
(ConfigHornSchunckPyramid config, InterpolatePixelS<GrayF32> interp) Configures flow estimation -
Method Summary
Modifier and TypeMethodDescriptionprotected static float
See equation 25.protected static float
See equation 25.getFlowX()
getFlowY()
protected void
interpolateFlowScale
(int widthNew, int heightNew) Provides an initial estimate for the flow by interpolating values from the previous layer.protected void
interpolateFlowScale
(GrayF32 prev, GrayF32 curr) Takes the flow from the previous lower resolution layer and uses it to initialize the flow in the current layer.void
process
(ImagePyramid<GrayF32> image1, ImagePyramid<GrayF32> image2) Computes dense optical flow from the provided image pyramid.protected void
processLayer
(GrayF32 image1, GrayF32 image2, GrayF32 derivX2, GrayF32 derivY2) Computes the flow for a layer using Taylor series expansion and Successive Over-Relaxation linear solver.protected static float
Ensures pixel values are inside the image.protected void
warpImageTaylor
(GrayF32 before, GrayF32 flowX, GrayF32 flowY, GrayF32 after) Takes the flow from the previous lower resolution layer and uses it to initialize the flow in the current layer.Methods inherited from class boofcv.alg.flow.DenseFlowPyramidBase
imageNormalization, process
-
Field Details
-
flowX
-
flowY
-
initFlowX
-
initFlowY
-
warpImage2
-
warpDeriv2X
-
warpDeriv2Y
-
-
Constructor Details
-
HornSchunckPyramid
Configures flow estimation- Parameters:
config
- Configuration parametersinterp
- Interpolation for image flow between image layers and warping. Overrides selection in config.
-
-
Method Details
-
process
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 classDenseFlowPyramidBase<T extends ImageGray<T>>
- Parameters:
image1
- Pyramid of first imageimage2
- Pyramid of second image
-
interpolateFlowScale
protected void interpolateFlowScale(int widthNew, int heightNew) Provides an initial estimate for the flow by interpolating values from the previous layer. -
interpolateFlowScale
Takes the flow from the previous lower resolution layer and uses it to initialize the flow in the current layer. Adjusts for change in image scale.- Overrides:
interpolateFlowScale
in classDenseFlowPyramidBase<T extends ImageGray<T>>
-
warpImageTaylor
Takes the flow from the previous lower resolution layer and uses it to initialize the flow in the current layer. Adjusts for change in image scale.- Overrides:
warpImageTaylor
in classDenseFlowPyramidBase<T extends ImageGray<T>>
-
processLayer
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. -
A_safe
See equation 25. Safe version -
A
See equation 25. Fast unsafe version -
safe
Ensures pixel values are inside the image. If output it is assigned to the nearest pixel inside the image -
getFlowX
-
getFlowY
-