mirror of
https://github.com/opencv/opencv.git
synced 2025-06-08 10:03:15 +08:00
features2d: add verbose messages into tests
To investigate sporadic failures of Features2d_FLANN_Auto.regression test.
This commit is contained in:
parent
24bed38c2b
commit
da6dc6774b
@ -112,11 +112,7 @@ int NearestNeighborTest::checkFind( const Mat& data )
|
|||||||
}
|
}
|
||||||
|
|
||||||
double correctPerc = correctMatches / (double)pointsCount;
|
double correctPerc = correctMatches / (double)pointsCount;
|
||||||
if (correctPerc < .75)
|
EXPECT_GE(correctPerc, .75) << "correctMatches=" << correctMatches << " pointsCount=" << pointsCount;
|
||||||
{
|
|
||||||
ts->printf( cvtest::TS::LOG, "correct_perc = %d\n", correctPerc );
|
|
||||||
code = cvtest::TS::FAIL_BAD_ACCURACY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
@ -152,6 +148,7 @@ void NearestNeighborTest::run( int /*start_from*/ ) {
|
|||||||
|
|
||||||
releaseModel();
|
releaseModel();
|
||||||
|
|
||||||
|
if (::testing::Test::HasFailure()) code = cvtest::TS::FAIL_BAD_ACCURACY;
|
||||||
ts->set_failed_test_info( code );
|
ts->set_failed_test_info( code );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,10 +198,9 @@ int CV_FlannTest::knnSearch( Mat& points, Mat& neighbors )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// compare results
|
// compare results
|
||||||
if( cvtest::norm( neighbors, neighbors1, NORM_L1 ) != 0 )
|
EXPECT_LE(cvtest::norm(neighbors, neighbors1, NORM_L1), 0);
|
||||||
return cvtest::TS::FAIL_BAD_ACCURACY;
|
|
||||||
|
|
||||||
return cvtest::TS::OK;
|
return ::testing::Test::HasFailure() ? cvtest::TS::FAIL_BAD_ACCURACY : cvtest::TS::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CV_FlannTest::radiusSearch( Mat& points, Mat& neighbors )
|
int CV_FlannTest::radiusSearch( Mat& points, Mat& neighbors )
|
||||||
@ -232,11 +228,11 @@ int CV_FlannTest::radiusSearch( Mat& points, Mat& neighbors )
|
|||||||
for( j = 0; it != indices.end(); ++it, j++ )
|
for( j = 0; it != indices.end(); ++it, j++ )
|
||||||
neighbors1.at<int>(i,j) = *it;
|
neighbors1.at<int>(i,j) = *it;
|
||||||
}
|
}
|
||||||
// compare results
|
|
||||||
if( cvtest::norm( neighbors, neighbors1, NORM_L1 ) != 0 )
|
|
||||||
return cvtest::TS::FAIL_BAD_ACCURACY;
|
|
||||||
|
|
||||||
return cvtest::TS::OK;
|
// compare results
|
||||||
|
EXPECT_LE(cvtest::norm(neighbors, neighbors1, NORM_L1), 0);
|
||||||
|
|
||||||
|
return ::testing::Test::HasFailure() ? cvtest::TS::FAIL_BAD_ACCURACY : cvtest::TS::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CV_FlannTest::releaseModel()
|
void CV_FlannTest::releaseModel()
|
||||||
|
Loading…
Reference in New Issue
Block a user