mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-19 19:44:14 +08:00
Complete DIS optical flow implementation
Added variational refinement as a separate class (based on implementation inside DeepFlow, but significantly accelerated, about 4-6 times faster), accelerated the main dense inverse search algorithm. Added several new features including patch mean normalization for increased robustness to illumination changes and spatial propagation, which often helps to recover from errors introduced by the coarse-to-fine scheme. Expanded the documentation, added new accuracy and perf tests. Refactored some of the already existing optical flow accuracy tests.
This commit is contained in:
@@ -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, sparsetodenseflow or DISflow] }"
|
||||
"{@algorithm | | [farneback, simpleflow, tvl1, deepflow, sparsetodenseflow, DISflow_ultrafast, DISflow_fast, DISflow_medium] }"
|
||||
"{@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" || method == "DISflow") && i1.channels() == 3 )
|
||||
if ( (method == "farneback" || method == "tvl1" || method == "deepflow" || method == "DISflow_ultrafast" || method == "DISflow_fast" || method == "DISflow_medium") && i1.channels() == 3 )
|
||||
{ // 1-channel images are expected
|
||||
cvtColor(i1, i1, COLOR_BGR2GRAY);
|
||||
cvtColor(i2, i2, COLOR_BGR2GRAY);
|
||||
@@ -252,8 +252,12 @@ int main( int argc, char** argv )
|
||||
algorithm = createOptFlow_DeepFlow();
|
||||
else if ( method == "sparsetodenseflow" )
|
||||
algorithm = createOptFlow_SparseToDense();
|
||||
else if ( method == "DISflow" )
|
||||
algorithm = createOptFlow_DIS();
|
||||
else if ( method == "DISflow_ultrafast" )
|
||||
algorithm = createOptFlow_DIS(DISOpticalFlow::PRESET_ULTRAFAST);
|
||||
else if (method == "DISflow_fast")
|
||||
algorithm = createOptFlow_DIS(DISOpticalFlow::PRESET_FAST);
|
||||
else if (method == "DISflow_medium")
|
||||
algorithm = createOptFlow_DIS(DISOpticalFlow::PRESET_MEDIUM);
|
||||
else
|
||||
{
|
||||
printf("Wrong method!\n");
|
||||
|
Reference in New Issue
Block a user