1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

optimized sparse LK optical flow (tickets #1062 and #1210)

This commit is contained in:
Vadim Pisarevsky
2011-07-11 23:03:05 +00:00
parent 442f6b4100
commit 21409de176
3 changed files with 493 additions and 628 deletions
+11 -11
View File
@@ -58,8 +58,8 @@ void CV_OptFlowPyrLKTest::run( int )
{
int code = cvtest::TS::OK;
const double success_error_level = 0.2;
const int bad_points_max = 2;
const double success_error_level = 0.3;
const int bad_points_max = 8;
/* test parameters */
double max_err = 0., sum_err = 0;
@@ -139,7 +139,7 @@ void CV_OptFlowPyrLKTest::run( int )
status = (char*)cvAlloc(n*sizeof(status[0]));
/* calculate flow */
cvCalcOpticalFlowPyrLK( imgI, imgJ, 0, 0, u, v2, n, cvSize( 20, 20 ),
cvCalcOpticalFlowPyrLK( imgI, imgJ, 0, 0, u, v2, n, cvSize( 41, 41 ),
4, status, 0, cvTermCriteria( CV_TERMCRIT_ITER|
CV_TERMCRIT_EPS, 30, 0.01f ), 0 );
@@ -163,14 +163,6 @@ void CV_OptFlowPyrLKTest::run( int )
}
pt_exceed += err > success_error_level;
if( pt_exceed > bad_points_max )
{
ts->printf( cvtest::TS::LOG,
"The number of poorly tracked points is too big (>=%d)\n", pt_exceed );
code = cvtest::TS::FAIL_BAD_ACCURACY;
goto _exit_;
}
sum_err += err;
pt_cmpd++;
}
@@ -186,6 +178,14 @@ void CV_OptFlowPyrLKTest::run( int )
}
}
}
if( pt_exceed > bad_points_max )
{
ts->printf( cvtest::TS::LOG,
"The number of poorly tracked points is too big (>=%d)\n", pt_exceed );
code = cvtest::TS::FAIL_BAD_ACCURACY;
goto _exit_;
}
if( max_err > 1 )
{