image = | deepFlow2dImg (inImg1,inImg2) |
image = | deepFlow2dImg (inImg1,inImg2,params) |
Computes a dense optical flow occurred between two input images.
This algorithm computes the optical flow between 2 input images using the deep flow algorithm [1].
The optical flow is the apparent motion of objects that occurred between two images. It relies on the assumption of intensity conservation and can be expressed as:
where is a pixel
in the image at the time
,
is the time between two frames and
is the displacement that occurred during
.
Assuming the displacement is small enough, this equation can be approximated by a first order Taylor expansion:
where is the partial derivative of the image along the dimension
.
Dividing by and using the intensity conservation assumption, the equation becomes:
where and
.
This equation can not be directly solved since we only have one equation for 2 unknowns to estimate.
The DeepFlow is one of the several technics to solve the equation above. It is a variational method that integrates a multiscale approach to overcome the limit of small displacement assumption.
In this algorithm, solving the optical flow problem consists in minimizing the energy defined as:
where is the energy of the data term, ensuring that the intensities stay close,
represents the smoothing term, ensuring a local consistency of the flow gradient and
is a matching term, ensuring that the estimated flow is close to the input a priori flow. In practice, this implementation stays to more standard variation model and ignores the mathcing term [2]. The equation becomes:
is iteratively minimized using a Successive Over-relaxation (SOR) approach, taking the flow estimated at the scale
as initialization of the estimation at the scale
.
The algorithm takes the following parameters:
The figure below presents and example of flow estimation. A random and smooth deformation field was applied to the image of lena. The deep flow was calculated with the folowing parameters: 200 layers (maximum), downscale factor = 0.95, 5 fixed point iterations, 25 SOR iterations, ,
,
,
:
[1] Philippe Weinzaepfel, Jerome Revaud, Zaid Harchaoui, and Cordelia Schmid. Deepflow: Large displacement optical flow with deep matching. In Computer Vision (ICCV), 2013 IEEE International Conference on, pages 1385�1392. IEEE, 2013.
[2] Brox, T., Bruhn, A., Papenberg, N., Weickert, J. (2004). High Accuracy Optical Flow Estimation Based on a Theory for Warping. In: Pajdla, T., Matas, J. (eds) Computer Vision - ECCV 2004. ECCV 2004.