Commit 3ff3cd84 authored by Maksim Shabunin's avatar Maksim Shabunin

Merge pull request #689 from sbokov:DIS_optical_flow

parents cd5993c6 d4c3765e
......@@ -37,3 +37,10 @@
year={2013},
organization={IEEE}
}
@article{Kroeger2016,
title={Fast Optical Flow using Dense Inverse Search},
author={Kroeger, Till and Timofte, Radu and Dai, Dengxin and Van Gool, Luc},
journal={arXiv preprint arXiv:1603.03590},
year={2016}
}
......@@ -191,6 +191,44 @@ CV_EXPORTS_W Ptr<DenseOpticalFlow> createOptFlow_Farneback();
//! Additional interface to the SparseToDenseFlow algorithm - calcOpticalFlowSparseToDense()
CV_EXPORTS_W Ptr<DenseOpticalFlow> createOptFlow_SparseToDense();
/** @brief DIS optical flow algorithm.
This class implements the Dense Inverse Search (DIS) optical flow algorithm. More
details about the algorithm can be found at @cite Kroeger2016 .
*/
class CV_EXPORTS_W DISOpticalFlow : public DenseOpticalFlow
{
public:
/** @brief Finest level of the gaussian pyramid on which the flow is computed (zero level
corresponds to the original image resolution).The final flow is obtained by bilinear upscaling.
@see setFinestScale */
virtual int getFinestScale() const = 0;
/** @copybrief getFinestScale @see getFinestScale */
virtual void setFinestScale(int val) = 0;
/** @brief Size of an image patch for matching (in pixels)
@see setPatchSize */
virtual int getPatchSize() const = 0;
/** @copybrief getPatchSize @see getPatchSize */
virtual void setPatchSize(int val) = 0;
/** @brief Stride between neighbor patches. Must be less than patch size.
@see setPatchStride */
virtual int getPatchStride() const = 0;
/** @copybrief getPatchStride @see getPatchStride */
virtual void setPatchStride(int val) = 0;
/** @brief number of gradient descent iterations in the patch inverse search stage
@see setGradientDescentIterations */
virtual int getGradientDescentIterations() const = 0;
/** @copybrief getGradientDescentIterations @see getGradientDescentIterations */
virtual void setGradientDescentIterations(int val) = 0;
};
/** @brief Creates an instance of DISOpticalFlow
*/
CV_EXPORTS_W Ptr<DISOpticalFlow> createOptFlow_DIS();
//! @}
} //optflow
......
This diff is collapsed.
......@@ -11,7 +11,7 @@ using namespace optflow;
const String keys = "{help h usage ? | | print this message }"
"{@image1 | | image1 }"
"{@image2 | | image2 }"
"{@algorithm | | [farneback, simpleflow, tvl1, deepflow or sparsetodenseflow] }"
"{@algorithm | | [farneback, simpleflow, tvl1, deepflow, sparsetodenseflow or DISflow] }"
"{@groundtruth | | path to the .flo file (optional), Middlebury format }"
"{m measure |endpoint| error measure - [endpoint or angular] }"
"{r region |all | region to compute stats about [all, discontinuities, untextured] }"
......@@ -229,7 +229,7 @@ int main( int argc, char** argv )
if ( i2.depth() != CV_8U )
i2.convertTo(i2, CV_8U);
if ( (method == "farneback" || method == "tvl1" || method == "deepflow") && i1.channels() == 3 )
if ( (method == "farneback" || method == "tvl1" || method == "deepflow" || method == "DISflow") && i1.channels() == 3 )
{ // 1-channel images are expected
cvtColor(i1, i1, COLOR_BGR2GRAY);
cvtColor(i2, i2, COLOR_BGR2GRAY);
......@@ -252,6 +252,8 @@ int main( int argc, char** argv )
algorithm = createOptFlow_DeepFlow();
else if ( method == "sparsetodenseflow" )
algorithm = createOptFlow_SparseToDense();
else if ( method == "DISflow" )
algorithm = createOptFlow_DIS();
else
{
printf("Wrong method!\n");
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment