public class HornSchunckPyramid<T extends boofcv.struct.image.ImageGray> extends DenseFlowPyramidBase<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).
| Modifier and Type | Field and Description |
|---|---|
protected boofcv.struct.image.GrayF32 |
flowX |
protected boofcv.struct.image.GrayF32 |
flowY |
protected boofcv.struct.image.GrayF32 |
initFlowX |
protected boofcv.struct.image.GrayF32 |
initFlowY |
protected boofcv.struct.image.GrayF32 |
warpDeriv2X |
protected boofcv.struct.image.GrayF32 |
warpDeriv2Y |
protected boofcv.struct.image.GrayF32 |
warpImage2 |
interp, pyr1, pyr2| Constructor and Description |
|---|
HornSchunckPyramid(ConfigHornSchunckPyramid config,
boofcv.alg.interpolate.InterpolatePixelS<boofcv.struct.image.GrayF32> interp)
Configures flow estimation
|
| Modifier and Type | Method and Description |
|---|---|
protected static float |
A_safe(int x,
int y,
boofcv.struct.image.GrayF32 flow)
See equation 25.
|
protected static float |
A(int x,
int y,
boofcv.struct.image.GrayF32 flow)
See equation 25.
|
boofcv.struct.image.GrayF32 |
getFlowX() |
boofcv.struct.image.GrayF32 |
getFlowY() |
protected void |
interpolateFlowScale(boofcv.struct.image.GrayF32 prev,
boofcv.struct.image.GrayF32 curr)
Takes the flow from the previous lower resolution layer and uses it to initialize the flow
in the current layer.
|
protected void |
interpolateFlowScale(int widthNew,
int heightNew)
Provides an initial estimate for the flow by interpolating values from the previous layer.
|
void |
process(boofcv.struct.pyramid.ImagePyramid<boofcv.struct.image.GrayF32> image1,
boofcv.struct.pyramid.ImagePyramid<boofcv.struct.image.GrayF32> image2)
Computes dense optical flow from the provided image pyramid.
|
protected void |
processLayer(boofcv.struct.image.GrayF32 image1,
boofcv.struct.image.GrayF32 image2,
boofcv.struct.image.GrayF32 derivX2,
boofcv.struct.image.GrayF32 derivY2)
Computes the flow for a layer using Taylor series expansion and Successive Over-Relaxation linear solver.
|
protected static float |
safe(int x,
int y,
boofcv.struct.image.GrayF32 image)
Ensures pixel values are inside the image.
|
protected void |
warpImageTaylor(boofcv.struct.image.GrayF32 before,
boofcv.struct.image.GrayF32 flowX,
boofcv.struct.image.GrayF32 flowY,
boofcv.struct.image.GrayF32 after)
Takes the flow from the previous lower resolution layer and uses it to initialize the flow
in the current layer.
|
imageNormalization, processprotected boofcv.struct.image.GrayF32 flowX
protected boofcv.struct.image.GrayF32 flowY
protected boofcv.struct.image.GrayF32 initFlowX
protected boofcv.struct.image.GrayF32 initFlowY
protected boofcv.struct.image.GrayF32 warpImage2
protected boofcv.struct.image.GrayF32 warpDeriv2X
protected boofcv.struct.image.GrayF32 warpDeriv2Y
public HornSchunckPyramid(ConfigHornSchunckPyramid config, boofcv.alg.interpolate.InterpolatePixelS<boofcv.struct.image.GrayF32> interp)
config - Configuration parametersinterp - Interpolation for image flow between image layers and warping. Overrides selection in config.public void process(boofcv.struct.pyramid.ImagePyramid<boofcv.struct.image.GrayF32> image1,
boofcv.struct.pyramid.ImagePyramid<boofcv.struct.image.GrayF32> image2)
process in class DenseFlowPyramidBase<T extends boofcv.struct.image.ImageGray>image1 - Pyramid of first imageimage2 - Pyramid of second imageprotected void interpolateFlowScale(int widthNew,
int heightNew)
protected void interpolateFlowScale(boofcv.struct.image.GrayF32 prev,
boofcv.struct.image.GrayF32 curr)
interpolateFlowScale in class DenseFlowPyramidBase<T extends boofcv.struct.image.ImageGray>protected void warpImageTaylor(boofcv.struct.image.GrayF32 before,
boofcv.struct.image.GrayF32 flowX,
boofcv.struct.image.GrayF32 flowY,
boofcv.struct.image.GrayF32 after)
warpImageTaylor in class DenseFlowPyramidBase<T extends boofcv.struct.image.ImageGray>protected void processLayer(boofcv.struct.image.GrayF32 image1,
boofcv.struct.image.GrayF32 image2,
boofcv.struct.image.GrayF32 derivX2,
boofcv.struct.image.GrayF32 derivY2)
protected static float A_safe(int x,
int y,
boofcv.struct.image.GrayF32 flow)
protected static float A(int x,
int y,
boofcv.struct.image.GrayF32 flow)
protected static float safe(int x,
int y,
boofcv.struct.image.GrayF32 image)
public boofcv.struct.image.GrayF32 getFlowX()
public boofcv.struct.image.GrayF32 getFlowY()