Package boofcv.alg.flow
Class BroxWarpingSpacial<T extends ImageGray<T>>
java.lang.Object
boofcv.alg.flow.DenseFlowPyramidBase<T>
boofcv.alg.flow.BroxWarpingSpacial<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].
- 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. http://dx.doi.org/10.5201/ipol.2013.21
- 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 Summary
Modifier and TypeFieldDescriptionprotected float
protected GrayF32
protected GrayF32
protected GrayF32
protected GrayF32
protected GrayF32
protected GrayF32
protected GrayF32
protected GrayF32
protected GrayF32
protected GrayF32
protected GrayF32
protected float
protected GrayF32
protected GrayF32
protected 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
ConstructorDescriptionBroxWarpingSpacial
(ConfigBroxWarping config, InterpolatePixelS<GrayF32> interp) Configures flow estimation -
Method Summary
Modifier and TypeMethodDescriptionprotected void
computeDivUVD_safe
(int x, int y, GrayF32 u, GrayF32 v, GrayF32 psi, GrayF32 divU, GrayF32 divV, GrayF32 divD) 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 5getFlowX()
getFlowY()
protected void
interpolateFlowScale
(int widthNew, int heightNew) Provides an initial estimate for the flow by interpolating values from the previous 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 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.protected void
resizeForLayer
(int width, int height) Resize images for the current layer being processedprotected int
s
(int x, int y) Methods inherited from class boofcv.alg.flow.DenseFlowPyramidBase
imageNormalization, interpolateFlowScale, process, warpImageTaylor
-
Field Details
-
alpha
protected float alpha -
gamma
protected float gamma -
flowU
-
flowV
-
warpImage2
-
warpDeriv2X
-
warpDeriv2Y
-
warpDeriv2XX
-
warpDeriv2YY
-
warpDeriv2XY
-
derivFlowUX
-
derivFlowUY
-
derivFlowVX
-
derivFlowVY
-
psiSmooth
-
psiData
-
psiGradient
-
divU
-
divV
-
divD
-
du
-
dv
-
-
Constructor Details
-
BroxWarpingSpacial
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
-
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
-
s
protected int s(int x, int y) -
getFlowX
-
getFlowY
-