Brightness constancy data term.
This implements the BC data term from the learning optical flow paper by Sun et. al.The data term energy looks likeIt is a general stencil wich is able to model various kinds of constancy and functions
for local weighting of the bcce data term. With preprocessing of the sequence data, other kinds of constancy like gradient constancy may be realized (providing filtered versions of the sequence as input to DataConstant).The stencil equations are derived using
:
Expanding this by the argument of
leads to
Taylor-expansion of the right part is the usual brighness constancy constraint equation (BCCE):
is now linearized by holding the first part fixed and using the BCCE taylor-expansion instead of the right part. Additionally
may be approximated by
:
Usually,
is symmetric (even), so
is antisymmetric (odd) wich may be used to simplify this further:
In the end, this is the usual BCCE stencil locally weighted by
This weight is used, if the option useDiff2Lin is set to true. Otherwise, the term of
is linearized direclty by tailer-expansion in
wich leads to the local weights
In practice, this turns out to perform worse than the linearization presented above, but both variants are avaliable for testing.As one may see above, using
of the first frame is an approximation, so optionally, setting useImg2 to true,
of the second image are used for calculations.
input slots | |
InputSlot< CImgList< T > > | it |
Image derivative inputs | |
InputSlot< CImgList< T > > | ix |
Image derivative inputs | |
InputSlot< CImgList< T > > | iy |
Image derivative inputs | |
InputSlot< CImgList< T > > | flowGuess |
initial guess of real flow, no zeros, even in warped mode | |
InputSlot< Function * > | psi |
brightness constancy energy function | |
output slots | |
parameters | |
Parameter< bool > | calcDifferences |
Calculate flow increments. | |
Parameter< bool > | useDiff2Lin |
use linearization of second derivative | |
Parameter< bool > | useImg2 |
Use derivatives ![]() |
This Module subclasses Stencil::Mask< T >.
For documentation of parameters and slots inherited by this base class,
please have a look at the corresponding Module reference.
This module is templated. There are instances with T=int,float,double.
An additional parameter called templatetype
may be used to select which instantiation you want.
The detailed doxygen documentation beyond the parameters/slots may be found here.