mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
ts: refactor OpenCV tests
- removed tr1 usage (dropped in C++17) - moved includes of vector/map/iostream/limits into ts.hpp - require opencv_test + anonymous namespace (added compile check) - fixed norm() usage (must be from cvtest::norm for checks) and other conflict functions - added missing license headers
This commit is contained in:
@@ -42,6 +42,8 @@
|
||||
|
||||
#include "test_precomp.hpp"
|
||||
|
||||
namespace opencv_test { namespace {
|
||||
|
||||
class CV_DecomposeProjectionMatrixTest : public cvtest::BaseTest
|
||||
{
|
||||
public:
|
||||
@@ -86,7 +88,7 @@ void CV_DecomposeProjectionMatrixTest::run(int start_from)
|
||||
rng.fill(rVec, cv::RNG::UNIFORM, -CV_PI, CV_PI);
|
||||
|
||||
cv::Matx33d origR;
|
||||
Rodrigues(rVec, origR);
|
||||
cv::Rodrigues(rVec, origR); // TODO cvtest
|
||||
|
||||
cv::Vec3d origT;
|
||||
rng.fill(origT, cv::RNG::NORMAL, 0, 1);
|
||||
@@ -111,19 +113,19 @@ void CV_DecomposeProjectionMatrixTest::run(int start_from)
|
||||
|
||||
|
||||
const double thresh = 1e-6;
|
||||
if ( norm(origK, K, cv::NORM_INF) > thresh )
|
||||
if (cv::norm(origK, K, cv::NORM_INF) > thresh)
|
||||
{
|
||||
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
||||
break;
|
||||
}
|
||||
|
||||
if ( norm(origR, R, cv::NORM_INF) > thresh )
|
||||
if (cv::norm(origR, R, cv::NORM_INF) > thresh)
|
||||
{
|
||||
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
||||
break;
|
||||
}
|
||||
|
||||
if ( norm(origT, t, cv::NORM_INF) > thresh )
|
||||
if (cv::norm(origT, t, cv::NORM_INF) > thresh)
|
||||
{
|
||||
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
||||
break;
|
||||
@@ -138,3 +140,5 @@ TEST(Calib3d_DecomposeProjectionMatrix, accuracy)
|
||||
CV_DecomposeProjectionMatrixTest test;
|
||||
test.safe_run();
|
||||
}
|
||||
|
||||
}} // namespace
|
||||
|
||||
Reference in New Issue
Block a user