mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Merge pull request #9770 from alalek:refactor_test_files
This commit is contained in:
commit
2a1f46c42d
@ -45,10 +45,10 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
typedef std::tr1::tuple<int, int> StereoBMFixture_t;
|
typedef tuple<int, int> StereoBMFixture_t;
|
||||||
typedef TestBaseWithParam<StereoBMFixture_t> StereoBMFixture;
|
typedef TestBaseWithParam<StereoBMFixture_t> StereoBMFixture;
|
||||||
|
|
||||||
OCL_PERF_TEST_P(StereoBMFixture, StereoBM, ::testing::Combine(OCL_PERF_ENUM(32, 64, 128), OCL_PERF_ENUM(11,21) ) )
|
OCL_PERF_TEST_P(StereoBMFixture, StereoBM, ::testing::Combine(OCL_PERF_ENUM(32, 64, 128), OCL_PERF_ENUM(11,21) ) )
|
||||||
|
@ -43,14 +43,9 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
namespace cvtest
|
namespace opencv_test
|
||||||
{
|
{
|
||||||
|
|
||||||
using std::tr1::tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using namespace testing;
|
|
||||||
using namespace cv;
|
|
||||||
|
|
||||||
CV_ENUM(Method, RANSAC, LMEDS)
|
CV_ENUM(Method, RANSAC, LMEDS)
|
||||||
typedef tuple<int, double, Method, size_t> AffineParams;
|
typedef tuple<int, double, Method, size_t> AffineParams;
|
||||||
@ -167,4 +162,4 @@ PERF_TEST_P( EstimateAffine, EstimateAffinePartial2D, ESTIMATE_PARAMS )
|
|||||||
SANITY_CHECK_NOTHING();
|
SANITY_CHECK_NOTHING();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace cvtest
|
} // namespace opencv_test
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
typedef std::tr1::tuple<std::string, cv::Size> String_Size_t;
|
typedef tuple<std::string, cv::Size> String_Size_t;
|
||||||
typedef perf::TestBaseWithParam<String_Size_t> String_Size;
|
typedef perf::TestBaseWithParam<String_Size_t> String_Size;
|
||||||
|
|
||||||
PERF_TEST_P(String_Size, asymm_circles_grid, testing::Values(
|
PERF_TEST_P(String_Size, asymm_circles_grid, testing::Values(
|
||||||
@ -40,3 +38,5 @@ PERF_TEST_P(String_Size, asymm_circles_grid, testing::Values(
|
|||||||
|
|
||||||
SANITY_CHECK(ptvec, 2);
|
SANITY_CHECK(ptvec, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,18 +1,12 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
#ifdef HAVE_TBB
|
namespace opencv_test
|
||||||
#include "tbb/task_scheduler_init.h"
|
{
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace cv;
|
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
CV_ENUM(pnpAlgo, SOLVEPNP_ITERATIVE, SOLVEPNP_EPNP, SOLVEPNP_P3P, SOLVEPNP_DLS, SOLVEPNP_UPNP)
|
CV_ENUM(pnpAlgo, SOLVEPNP_ITERATIVE, SOLVEPNP_EPNP, SOLVEPNP_P3P, SOLVEPNP_DLS, SOLVEPNP_UPNP)
|
||||||
|
|
||||||
typedef std::tr1::tuple<int, pnpAlgo> PointsNum_Algo_t;
|
typedef tuple<int, pnpAlgo> PointsNum_Algo_t;
|
||||||
typedef perf::TestBaseWithParam<PointsNum_Algo_t> PointsNum_Algo;
|
typedef perf::TestBaseWithParam<PointsNum_Algo_t> PointsNum_Algo;
|
||||||
|
|
||||||
typedef perf::TestBaseWithParam<int> PointsNum;
|
typedef perf::TestBaseWithParam<int> PointsNum;
|
||||||
@ -48,14 +42,14 @@ PERF_TEST_P(PointsNum_Algo, solvePnP,
|
|||||||
//add noise
|
//add noise
|
||||||
Mat noise(1, (int)points2d.size(), CV_32FC2);
|
Mat noise(1, (int)points2d.size(), CV_32FC2);
|
||||||
randu(noise, 0, 0.01);
|
randu(noise, 0, 0.01);
|
||||||
add(points2d, noise, points2d);
|
cv::add(points2d, noise, points2d);
|
||||||
|
|
||||||
declare.in(points3d, points2d);
|
declare.in(points3d, points2d);
|
||||||
declare.time(100);
|
declare.time(100);
|
||||||
|
|
||||||
TEST_CYCLE_N(1000)
|
TEST_CYCLE_N(1000)
|
||||||
{
|
{
|
||||||
solvePnP(points3d, points2d, intrinsics, distortion, rvec, tvec, false, algo);
|
cv::solvePnP(points3d, points2d, intrinsics, distortion, rvec, tvec, false, algo);
|
||||||
}
|
}
|
||||||
|
|
||||||
SANITY_CHECK(rvec, 1e-6);
|
SANITY_CHECK(rvec, 1e-6);
|
||||||
@ -92,22 +86,22 @@ PERF_TEST_P(PointsNum_Algo, solvePnPSmallPoints,
|
|||||||
|
|
||||||
// normalize Rodrigues vector
|
// normalize Rodrigues vector
|
||||||
Mat rvec_tmp = Mat::eye(3, 3, CV_32F);
|
Mat rvec_tmp = Mat::eye(3, 3, CV_32F);
|
||||||
Rodrigues(rvec, rvec_tmp);
|
cv::Rodrigues(rvec, rvec_tmp);
|
||||||
Rodrigues(rvec_tmp, rvec);
|
cv::Rodrigues(rvec_tmp, rvec);
|
||||||
|
|
||||||
projectPoints(points3d, rvec, tvec, intrinsics, distortion, points2d);
|
cv::projectPoints(points3d, rvec, tvec, intrinsics, distortion, points2d);
|
||||||
|
|
||||||
//add noise
|
//add noise
|
||||||
Mat noise(1, (int)points2d.size(), CV_32FC2);
|
Mat noise(1, (int)points2d.size(), CV_32FC2);
|
||||||
randu(noise, -0.001, 0.001);
|
randu(noise, -0.001, 0.001);
|
||||||
add(points2d, noise, points2d);
|
cv::add(points2d, noise, points2d);
|
||||||
|
|
||||||
declare.in(points3d, points2d);
|
declare.in(points3d, points2d);
|
||||||
declare.time(100);
|
declare.time(100);
|
||||||
|
|
||||||
TEST_CYCLE_N(1000)
|
TEST_CYCLE_N(1000)
|
||||||
{
|
{
|
||||||
solvePnP(points3d, points2d, intrinsics, distortion, rvec, tvec, false, algo);
|
cv::solvePnP(points3d, points2d, intrinsics, distortion, rvec, tvec, false, algo);
|
||||||
}
|
}
|
||||||
|
|
||||||
SANITY_CHECK(rvec, 1e-1);
|
SANITY_CHECK(rvec, 1e-1);
|
||||||
@ -144,16 +138,13 @@ PERF_TEST_P(PointsNum, DISABLED_SolvePnPRansac, testing::Values(5, 3*9, 7*13))
|
|||||||
Mat rvec;
|
Mat rvec;
|
||||||
Mat tvec;
|
Mat tvec;
|
||||||
|
|
||||||
#ifdef HAVE_TBB
|
|
||||||
// limit concurrency to get deterministic result
|
|
||||||
tbb::task_scheduler_init one_thread(1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
TEST_CYCLE()
|
TEST_CYCLE()
|
||||||
{
|
{
|
||||||
solvePnPRansac(object, image, camera_mat, dist_coef, rvec, tvec);
|
cv::solvePnPRansac(object, image, camera_mat, dist_coef, rvec, tvec);
|
||||||
}
|
}
|
||||||
|
|
||||||
SANITY_CHECK(rvec, 1e-6);
|
SANITY_CHECK(rvec, 1e-6);
|
||||||
SANITY_CHECK(tvec, 1e-6);
|
SANITY_CHECK(tvec, 1e-6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,21 +1,10 @@
|
|||||||
#ifdef __GNUC__
|
// This file is part of OpenCV project.
|
||||||
# pragma GCC diagnostic ignored "-Wmissing-declarations"
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
# if defined __clang__ || defined __APPLE__
|
// of this distribution and at http://opencv.org/license.html
|
||||||
# pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
|
||||||
# pragma GCC diagnostic ignored "-Wextra"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __OPENCV_PERF_PRECOMP_HPP__
|
#ifndef __OPENCV_PERF_PRECOMP_HPP__
|
||||||
#define __OPENCV_PERF_PRECOMP_HPP__
|
#define __OPENCV_PERF_PRECOMP_HPP__
|
||||||
|
|
||||||
#include "opencv2/ts.hpp"
|
#include "opencv2/ts.hpp"
|
||||||
#include "opencv2/calib3d.hpp"
|
#include "opencv2/calib3d.hpp"
|
||||||
#include "opencv2/imgcodecs.hpp"
|
|
||||||
#include "opencv2/imgproc.hpp"
|
|
||||||
|
|
||||||
#ifdef GTEST_CREATE_SHARED_LIBRARY
|
|
||||||
#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
namespace cvtest
|
namespace opencv_test
|
||||||
{
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using namespace testing;
|
using namespace testing;
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
PARAM_TEST_CASE(StereoBMFixture, int, int)
|
PARAM_TEST_CASE(StereoBMFixture, int, int)
|
||||||
|
@ -41,12 +41,7 @@
|
|||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
using namespace testing;
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <numeric>
|
|
||||||
|
|
||||||
CV_ENUM(Method, RANSAC, LMEDS)
|
CV_ENUM(Method, RANSAC, LMEDS)
|
||||||
typedef TestWithParam<Method> EstimateAffine2D;
|
typedef TestWithParam<Method> EstimateAffine2D;
|
||||||
@ -156,3 +151,5 @@ TEST_P(EstimateAffine2D, testConversion)
|
|||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Calib3d, EstimateAffine2D, Method::all());
|
INSTANTIATE_TEST_CASE_P(Calib3d, EstimateAffine2D, Method::all());
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -42,8 +42,8 @@
|
|||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "opencv2/core/affine.hpp"
|
#include "opencv2/core/affine.hpp"
|
||||||
#include "opencv2/calib3d.hpp"
|
|
||||||
#include <iostream>
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
TEST(Calib3d_Affine3f, accuracy)
|
TEST(Calib3d_Affine3f, accuracy)
|
||||||
{
|
{
|
||||||
@ -106,3 +106,5 @@ TEST(Calib3d_Affine3f, accuracy_rvec)
|
|||||||
ASSERT_LT(cvtest::norm(va, vo, cv::NORM_L2), 1e-9);
|
ASSERT_LT(cvtest::norm(va, vo, cv::NORM_L2), 1e-9);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -42,16 +42,7 @@
|
|||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
|
||||||
#include <functional>
|
|
||||||
#include <iterator>
|
|
||||||
#include <limits>
|
|
||||||
#include <numeric>
|
|
||||||
|
|
||||||
class CV_Affine3D_EstTest : public cvtest::BaseTest
|
class CV_Affine3D_EstTest : public cvtest::BaseTest
|
||||||
{
|
{
|
||||||
@ -101,7 +92,7 @@ bool CV_Affine3D_EstTest::test4Points()
|
|||||||
fpts.ptr<Point3f>()[2] = Point3f( rngIn(1,2), rngIn(3,4), rngIn(5, 6) );
|
fpts.ptr<Point3f>()[2] = Point3f( rngIn(1,2), rngIn(3,4), rngIn(5, 6) );
|
||||||
fpts.ptr<Point3f>()[3] = Point3f( rngIn(3,4), rngIn(1,2), rngIn(5, 6) );
|
fpts.ptr<Point3f>()[3] = Point3f( rngIn(3,4), rngIn(1,2), rngIn(5, 6) );
|
||||||
|
|
||||||
transform(fpts.ptr<Point3f>(), fpts.ptr<Point3f>() + 4, tpts.ptr<Point3f>(), WrapAff(aff));
|
std::transform(fpts.ptr<Point3f>(), fpts.ptr<Point3f>() + 4, tpts.ptr<Point3f>(), WrapAff(aff));
|
||||||
|
|
||||||
Mat aff_est;
|
Mat aff_est;
|
||||||
vector<uchar> outliers;
|
vector<uchar> outliers;
|
||||||
@ -144,11 +135,11 @@ bool CV_Affine3D_EstTest::testNPoints()
|
|||||||
Mat tpts(1, n, CV_32FC3);
|
Mat tpts(1, n, CV_32FC3);
|
||||||
|
|
||||||
randu(fpts, Scalar::all(0), Scalar::all(100));
|
randu(fpts, Scalar::all(0), Scalar::all(100));
|
||||||
transform(fpts.ptr<Point3f>(), fpts.ptr<Point3f>() + n, tpts.ptr<Point3f>(), WrapAff(aff));
|
std::transform(fpts.ptr<Point3f>(), fpts.ptr<Point3f>() + n, tpts.ptr<Point3f>(), WrapAff(aff));
|
||||||
|
|
||||||
/* adding noise*/
|
/* adding noise*/
|
||||||
transform(tpts.ptr<Point3f>() + m, tpts.ptr<Point3f>() + n, tpts.ptr<Point3f>() + m, bind2nd(plus<Point3f>(), shift_outl));
|
std::transform(tpts.ptr<Point3f>() + m, tpts.ptr<Point3f>() + n, tpts.ptr<Point3f>() + m, std::bind2nd(std::plus<Point3f>(), shift_outl));
|
||||||
transform(tpts.ptr<Point3f>() + m, tpts.ptr<Point3f>() + n, tpts.ptr<Point3f>() + m, Noise(noise_level));
|
std::transform(tpts.ptr<Point3f>() + m, tpts.ptr<Point3f>() + n, tpts.ptr<Point3f>() + m, Noise(noise_level));
|
||||||
|
|
||||||
Mat aff_est;
|
Mat aff_est;
|
||||||
vector<uchar> outl;
|
vector<uchar> outl;
|
||||||
@ -195,3 +186,5 @@ void CV_Affine3D_EstTest::run( int /* start_from */)
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(Calib3d_EstimateAffine3D, accuracy) { CV_Affine3D_EstTest test; test.safe_run(); }
|
TEST(Calib3d_EstimateAffine3D, accuracy) { CV_Affine3D_EstTest test; test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -41,12 +41,7 @@
|
|||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
using namespace testing;
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <numeric>
|
|
||||||
|
|
||||||
CV_ENUM(Method, RANSAC, LMEDS)
|
CV_ENUM(Method, RANSAC, LMEDS)
|
||||||
typedef TestWithParam<Method> EstimateAffinePartial2D;
|
typedef TestWithParam<Method> EstimateAffinePartial2D;
|
||||||
@ -165,3 +160,5 @@ TEST_P(EstimateAffinePartial2D, testConversion)
|
|||||||
}
|
}
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Calib3d, EstimateAffinePartial2D, Method::all());
|
INSTANTIATE_TEST_CASE_P(Calib3d, EstimateAffinePartial2D, Method::all());
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -42,10 +42,7 @@
|
|||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "opencv2/calib3d/calib3d_c.h"
|
#include "opencv2/calib3d/calib3d_c.h"
|
||||||
|
|
||||||
#include <limits>
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace cv;
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
class CV_ProjectPointsTest : public cvtest::ArrayTest
|
class CV_ProjectPointsTest : public cvtest::ArrayTest
|
||||||
@ -861,7 +858,7 @@ void CV_CameraCalibrationTest_CPP::calibrate(int imageCount, int* pointCounts,
|
|||||||
for( int i = 0; i < imageCount; ++rvecsIt, ++tvecsIt, i++, rm+=9, tm+=3 )
|
for( int i = 0; i < imageCount; ++rvecsIt, ++tvecsIt, i++, rm+=9, tm+=3 )
|
||||||
{
|
{
|
||||||
Mat r9( 3, 3, CV_64FC1 );
|
Mat r9( 3, 3, CV_64FC1 );
|
||||||
Rodrigues( *rvecsIt, r9 );
|
cvtest::Rodrigues( *rvecsIt, r9 );
|
||||||
memcpy( rm, r9.ptr(), 9*sizeof(double) );
|
memcpy( rm, r9.ptr(), 9*sizeof(double) );
|
||||||
memcpy( tm, tvecsIt->ptr(), 3*sizeof(double) );
|
memcpy( tm, tvecsIt->ptr(), 3*sizeof(double) );
|
||||||
}
|
}
|
||||||
@ -878,7 +875,7 @@ void CV_CameraCalibrationTest_CPP::project( int pointCount, CvPoint3D64f* _objec
|
|||||||
Mat cameraMatrix( 3, 3, CV_64FC1, _cameraMatrix );
|
Mat cameraMatrix( 3, 3, CV_64FC1, _cameraMatrix );
|
||||||
Mat distCoeffs( 1, 4, CV_64FC1, distortion );
|
Mat distCoeffs( 1, 4, CV_64FC1, distortion );
|
||||||
vector<Point2f> imagePoints;
|
vector<Point2f> imagePoints;
|
||||||
Rodrigues( rmat, rvec );
|
cvtest::Rodrigues( rmat, rvec );
|
||||||
|
|
||||||
objectPoints.convertTo( objectPoints, CV_32FC1 );
|
objectPoints.convertTo( objectPoints, CV_32FC1 );
|
||||||
projectPoints( objectPoints, rvec, tvec,
|
projectPoints( objectPoints, rvec, tvec,
|
||||||
@ -982,7 +979,7 @@ void CV_CalibrationMatrixValuesTest::run(int)
|
|||||||
code = cvtest::TS::FAIL_BAD_ACCURACY;
|
code = cvtest::TS::FAIL_BAD_ACCURACY;
|
||||||
goto _exit_;
|
goto _exit_;
|
||||||
}
|
}
|
||||||
if( norm( principalPoint - goodPrincipalPoint ) > FLT_EPSILON )
|
if( cv::norm(principalPoint - goodPrincipalPoint) > FLT_EPSILON ) // Point2d
|
||||||
{
|
{
|
||||||
ts->printf( cvtest::TS::LOG, "bad principalPoint\n" );
|
ts->printf( cvtest::TS::LOG, "bad principalPoint\n" );
|
||||||
code = cvtest::TS::FAIL_BAD_ACCURACY;
|
code = cvtest::TS::FAIL_BAD_ACCURACY;
|
||||||
@ -1117,7 +1114,8 @@ void CV_ProjectPointsTest::run(int)
|
|||||||
rvec(0,0) = rng.uniform( rMinVal, rMaxVal );
|
rvec(0,0) = rng.uniform( rMinVal, rMaxVal );
|
||||||
rvec(0,1) = rng.uniform( rMinVal, rMaxVal );
|
rvec(0,1) = rng.uniform( rMinVal, rMaxVal );
|
||||||
rvec(0,2) = rng.uniform( rMinVal, rMaxVal );
|
rvec(0,2) = rng.uniform( rMinVal, rMaxVal );
|
||||||
Rodrigues( rvec, rmat );
|
rmat = cv::Mat_<float>::zeros(3, 3);
|
||||||
|
cvtest::Rodrigues( rvec, rmat );
|
||||||
|
|
||||||
tvec(0,0) = rng.uniform( tMinVal, tMaxVal );
|
tvec(0,0) = rng.uniform( tMinVal, tMaxVal );
|
||||||
tvec(0,1) = rng.uniform( tMinVal, tMaxVal );
|
tvec(0,1) = rng.uniform( tMinVal, tMaxVal );
|
||||||
@ -2135,7 +2133,7 @@ TEST(Calib3d_Triangulate, accuracy)
|
|||||||
Mat res_, res;
|
Mat res_, res;
|
||||||
|
|
||||||
triangulatePoints(P1, P2, x1, x2, res_);
|
triangulatePoints(P1, P2, x1, x2, res_);
|
||||||
transpose(res_, res_);
|
cv::transpose(res_, res_); // TODO cvtest (transpose doesn't support inplace)
|
||||||
convertPointsFromHomogeneous(res_, res);
|
convertPointsFromHomogeneous(res_, res);
|
||||||
res = res.reshape(1, 1);
|
res = res.reshape(1, 1);
|
||||||
|
|
||||||
@ -2143,7 +2141,7 @@ TEST(Calib3d_Triangulate, accuracy)
|
|||||||
cout << "\tres0: " << res0 << endl;
|
cout << "\tres0: " << res0 << endl;
|
||||||
cout << "\tres: " << res << endl;
|
cout << "\tres: " << res << endl;
|
||||||
|
|
||||||
ASSERT_LE(norm(res, res0, NORM_INF), 1e-1);
|
ASSERT_LE(cvtest::norm(res, res0, NORM_INF), 1e-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// another testcase http://code.opencv.org/issues/3461
|
// another testcase http://code.opencv.org/issues/3461
|
||||||
@ -2175,7 +2173,7 @@ TEST(Calib3d_Triangulate, accuracy)
|
|||||||
Mat res_, res;
|
Mat res_, res;
|
||||||
|
|
||||||
triangulatePoints(P1, P2, x1, x2, res_);
|
triangulatePoints(P1, P2, x1, x2, res_);
|
||||||
transpose(res_, res_);
|
cv::transpose(res_, res_); // TODO cvtest (transpose doesn't support inplace)
|
||||||
convertPointsFromHomogeneous(res_, res);
|
convertPointsFromHomogeneous(res_, res);
|
||||||
res = res.reshape(1, 1);
|
res = res.reshape(1, 1);
|
||||||
|
|
||||||
@ -2183,6 +2181,8 @@ TEST(Calib3d_Triangulate, accuracy)
|
|||||||
cout << "\tres0: " << res0 << endl;
|
cout << "\tres0: " << res0 << endl;
|
||||||
cout << "\tres: " << res << endl;
|
cout << "\tres: " << res << endl;
|
||||||
|
|
||||||
ASSERT_LE(norm(res, res0, NORM_INF), 2);
|
ASSERT_LE(cvtest::norm(res, res0, NORM_INF), 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -41,18 +41,9 @@
|
|||||||
//M*/
|
//M*/
|
||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <limits>
|
|
||||||
#include <vector>
|
|
||||||
#include <iostream>
|
|
||||||
#include <sstream>
|
|
||||||
#include <iomanip>
|
|
||||||
|
|
||||||
#include "test_chessboardgenerator.hpp"
|
#include "test_chessboardgenerator.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
//template<class T> ostream& operator<<(ostream& out, const Mat_<T>& mat)
|
//template<class T> ostream& operator<<(ostream& out, const Mat_<T>& mat)
|
||||||
//{
|
//{
|
||||||
@ -75,10 +66,10 @@ Mat calcRvec(const vector<Point3f>& points, const Size& cornerSize)
|
|||||||
Mat rot(3, 3, CV_64F);
|
Mat rot(3, 3, CV_64F);
|
||||||
*rot.ptr<Vec3d>(0) = ex;
|
*rot.ptr<Vec3d>(0) = ex;
|
||||||
*rot.ptr<Vec3d>(1) = ey;
|
*rot.ptr<Vec3d>(1) = ey;
|
||||||
*rot.ptr<Vec3d>(2) = ez * (1.0/norm(ez));
|
*rot.ptr<Vec3d>(2) = ez * (1.0/cv::norm(ez)); // TODO cvtest
|
||||||
|
|
||||||
Mat res;
|
Mat res;
|
||||||
Rodrigues(rot.t(), res);
|
cvtest::Rodrigues(rot.t(), res);
|
||||||
return res.reshape(1, 1);
|
return res.reshape(1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,7 +165,9 @@ protected:
|
|||||||
const Point3d& tvec = *tvecs[i].ptr<Point3d>();
|
const Point3d& tvec = *tvecs[i].ptr<Point3d>();
|
||||||
const Point3d& tvec_est = *tvecs_est[i].ptr<Point3d>();
|
const Point3d& tvec_est = *tvecs_est[i].ptr<Point3d>();
|
||||||
|
|
||||||
if (norm(tvec_est - tvec) > eps* (norm(tvec) + dlt))
|
double n1 = cv::norm(tvec_est - tvec); // TODO cvtest
|
||||||
|
double n2 = cv::norm(tvec); // TODO cvtest
|
||||||
|
if (n1 > eps* (n2 + dlt))
|
||||||
{
|
{
|
||||||
if (err_count++ < errMsgNum)
|
if (err_count++ < errMsgNum)
|
||||||
{
|
{
|
||||||
@ -183,7 +176,7 @@ protected:
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ts->printf( cvtest::TS::LOG, "%d) Bad accuracy in returned tvecs. Index = %d\n", r, i);
|
ts->printf( cvtest::TS::LOG, "%d) Bad accuracy in returned tvecs. Index = %d\n", r, i);
|
||||||
ts->printf( cvtest::TS::LOG, "%d) norm(tvec_est - tvec) = %f, norm(tvec_exp) = %f \n", r, norm(tvec_est - tvec), norm(tvec));
|
ts->printf( cvtest::TS::LOG, "%d) norm(tvec_est - tvec) = %f, norm(tvec_exp) = %f \n", r, n1, n2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
||||||
@ -201,8 +194,8 @@ protected:
|
|||||||
const int errMsgNum = 4;
|
const int errMsgNum = 4;
|
||||||
for(size_t i = 0; i < rvecs.size(); ++i)
|
for(size_t i = 0; i < rvecs.size(); ++i)
|
||||||
{
|
{
|
||||||
Rodrigues(rvecs[i], rmat);
|
cvtest::Rodrigues(rvecs[i], rmat);
|
||||||
Rodrigues(rvecs_est[i], rmat_est);
|
cvtest::Rodrigues(rvecs_est[i], rmat_est);
|
||||||
|
|
||||||
if (cvtest::norm(rmat_est, rmat, NORM_L2) > eps* (cvtest::norm(rmat, NORM_L2) + dlt))
|
if (cvtest::norm(rmat_est, rmat, NORM_L2) > eps* (cvtest::norm(rmat, NORM_L2) + dlt))
|
||||||
{
|
{
|
||||||
@ -237,7 +230,7 @@ protected:
|
|||||||
projectPoints(_chessboard3D, _rvecs_exp[i], _tvecs_exp[i], eye33, zero15, uv_exp);
|
projectPoints(_chessboard3D, _rvecs_exp[i], _tvecs_exp[i], eye33, zero15, uv_exp);
|
||||||
projectPoints(_chessboard3D, rvecs_est[i], tvecs_est[i], eye33, zero15, uv_est);
|
projectPoints(_chessboard3D, rvecs_est[i], tvecs_est[i], eye33, zero15, uv_est);
|
||||||
for(size_t j = 0; j < cb3d.size(); ++j)
|
for(size_t j = 0; j < cb3d.size(); ++j)
|
||||||
res += norm(uv_exp[i] - uv_est[i]);
|
res += cv::norm(uv_exp[i] - uv_est[i]); // TODO cvtest
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -429,3 +422,5 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
TEST(Calib3d_CalibrateCamera_CPP, DISABLED_accuracy_on_artificial_data) { CV_CalibrateCameraArtificialTest test; test.safe_run(); }
|
TEST(Calib3d_CalibrateCamera_CPP, DISABLED_accuracy_on_artificial_data) { CV_CalibrateCameraArtificialTest test; test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -43,10 +43,7 @@
|
|||||||
#include "test_chessboardgenerator.hpp"
|
#include "test_chessboardgenerator.hpp"
|
||||||
#include "opencv2/calib3d/calib3d_c.h"
|
#include "opencv2/calib3d/calib3d_c.h"
|
||||||
|
|
||||||
#include <iostream>
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
using namespace cv;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class CV_CameraCalibrationBadArgTest : public cvtest::BadArgTest
|
class CV_CameraCalibrationBadArgTest : public cvtest::BadArgTest
|
||||||
{
|
{
|
||||||
@ -507,8 +504,8 @@ protected:
|
|||||||
objectPoints_c = objectPoints_cpp;
|
objectPoints_c = objectPoints_cpp;
|
||||||
|
|
||||||
Mat t_vec_cpp(Mat::zeros(1, 3, CV_32F)); t_vec_c = t_vec_cpp;
|
Mat t_vec_cpp(Mat::zeros(1, 3, CV_32F)); t_vec_c = t_vec_cpp;
|
||||||
Mat r_vec_cpp;
|
Mat r_vec_cpp(3, 1, CV_32F);
|
||||||
Rodrigues(Mat::eye(3, 3, CV_32F), r_vec_cpp); r_vec_c = r_vec_cpp;
|
cvtest::Rodrigues(Mat::eye(3, 3, CV_32F), r_vec_cpp); r_vec_c = r_vec_cpp;
|
||||||
|
|
||||||
Mat A_cpp = camMat.clone(); A_c = A_cpp;
|
Mat A_cpp = camMat.clone(); A_c = A_cpp;
|
||||||
Mat distCoeffs_cpp = distCoeffs.clone(); distCoeffs_c = distCoeffs_cpp;
|
Mat distCoeffs_cpp = distCoeffs.clone(); distCoeffs_c = distCoeffs_cpp;
|
||||||
@ -735,3 +732,5 @@ protected:
|
|||||||
TEST(Calib3d_CalibrateCamera_C, badarg) { CV_CameraCalibrationBadArgTest test; test.safe_run(); }
|
TEST(Calib3d_CalibrateCamera_C, badarg) { CV_CameraCalibrationBadArgTest test; test.safe_run(); }
|
||||||
TEST(Calib3d_Rodrigues_C, badarg) { CV_Rodrigues2BadArgTest test; test.safe_run(); }
|
TEST(Calib3d_Rodrigues_C, badarg) { CV_Rodrigues2BadArgTest test; test.safe_run(); }
|
||||||
TEST(Calib3d_ProjectPoints_C, badarg) { CV_ProjectPoints2BadArgTest test; test.safe_run(); }
|
TEST(Calib3d_ProjectPoints_C, badarg) { CV_ProjectPoints2BadArgTest test; test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -41,8 +41,9 @@
|
|||||||
//M*/
|
//M*/
|
||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include <opencv2/ts/cuda_test.hpp>
|
#include "opencv2/ts/cuda_test.hpp" // EXPECT_MAT_NEAR
|
||||||
#include "opencv2/calib3d.hpp"
|
|
||||||
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
#define NUM_DIST_COEFF_TILT 14
|
#define NUM_DIST_COEFF_TILT 14
|
||||||
|
|
||||||
@ -664,24 +665,14 @@ TEST_F(cameraCalibrationTiltTest, calibrateCamera)
|
|||||||
// back projection error
|
// back projection error
|
||||||
for (size_t i = 0; i < viewsNoisyImagePoints.size(); ++i)
|
for (size_t i = 0; i < viewsNoisyImagePoints.size(); ++i)
|
||||||
{
|
{
|
||||||
double dRvec = norm(
|
double dRvec = cv::norm(m_pointTargetRvec[i],
|
||||||
m_pointTargetRvec[i] -
|
cv::Vec3d(outRvecs[i].at<double>(0), outRvecs[i].at<double>(1), outRvecs[i].at<double>(2))
|
||||||
cv::Vec3d(
|
);
|
||||||
outRvecs[i].at<double>(0),
|
EXPECT_LE(dRvec, tolRvec);
|
||||||
outRvecs[i].at<double>(1),
|
double dTvec = cv::norm(m_pointTargetTvec[i],
|
||||||
outRvecs[i].at<double>(2)));
|
cv::Vec3d(outTvecs[i].at<double>(0), outTvecs[i].at<double>(1), outTvecs[i].at<double>(2))
|
||||||
// std::cout << dRvec << " " << tolRvec << "\n";
|
);
|
||||||
EXPECT_LE(dRvec,
|
EXPECT_LE(dTvec, tolTvec);
|
||||||
tolRvec);
|
|
||||||
double dTvec = norm(
|
|
||||||
m_pointTargetTvec[i] -
|
|
||||||
cv::Vec3d(
|
|
||||||
outTvecs[i].at<double>(0),
|
|
||||||
outTvecs[i].at<double>(1),
|
|
||||||
outTvecs[i].at<double>(2)));
|
|
||||||
// std::cout << dTvec << " " << tolTvec << "\n";
|
|
||||||
EXPECT_LE(dTvec,
|
|
||||||
tolTvec);
|
|
||||||
|
|
||||||
std::vector<cv::Point2f> backProjection;
|
std::vector<cv::Point2f> backProjection;
|
||||||
cv::projectPoints(
|
cv::projectPoints(
|
||||||
@ -698,3 +689,5 @@ TEST_F(cameraCalibrationTiltTest, calibrateCamera)
|
|||||||
pixelNoiseHalfWidth *= .25;
|
pixelNoiseHalfWidth *= .25;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -43,28 +43,24 @@
|
|||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "test_chessboardgenerator.hpp"
|
#include "test_chessboardgenerator.hpp"
|
||||||
|
|
||||||
#include <vector>
|
namespace cv {
|
||||||
#include <iterator>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
using namespace cv;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
ChessBoardGenerator::ChessBoardGenerator(const Size& _patternSize) : sensorWidth(32), sensorHeight(24),
|
ChessBoardGenerator::ChessBoardGenerator(const Size& _patternSize) : sensorWidth(32), sensorHeight(24),
|
||||||
squareEdgePointsNum(200), min_cos(std::sqrt(3.f)*0.5f), cov(0.5),
|
squareEdgePointsNum(200), min_cos(std::sqrt(3.f)*0.5f), cov(0.5),
|
||||||
patternSize(_patternSize), rendererResolutionMultiplier(4), tvec(Mat::zeros(1, 3, CV_32F))
|
patternSize(_patternSize), rendererResolutionMultiplier(4), tvec(Mat::zeros(1, 3, CV_32F))
|
||||||
{
|
{
|
||||||
Rodrigues(Mat::eye(3, 3, CV_32F), rvec);
|
rvec.create(3, 1, CV_32F);
|
||||||
|
cvtest::Rodrigues(Mat::eye(3, 3, CV_32F), rvec);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cv::ChessBoardGenerator::generateEdge(const Point3f& p1, const Point3f& p2, vector<Point3f>& out) const
|
void ChessBoardGenerator::generateEdge(const Point3f& p1, const Point3f& p2, vector<Point3f>& out) const
|
||||||
{
|
{
|
||||||
Point3f step = (p2 - p1) * (1.f/squareEdgePointsNum);
|
Point3f step = (p2 - p1) * (1.f/squareEdgePointsNum);
|
||||||
for(size_t n = 0; n < squareEdgePointsNum; ++n)
|
for(size_t n = 0; n < squareEdgePointsNum; ++n)
|
||||||
out.push_back( p1 + step * (float)n);
|
out.push_back( p1 + step * (float)n);
|
||||||
}
|
}
|
||||||
|
|
||||||
Size cv::ChessBoardGenerator::cornersSize() const
|
Size ChessBoardGenerator::cornersSize() const
|
||||||
{
|
{
|
||||||
return Size(patternSize.width-1, patternSize.height-1);
|
return Size(patternSize.width-1, patternSize.height-1);
|
||||||
}
|
}
|
||||||
@ -76,7 +72,7 @@ struct Mult
|
|||||||
Point2f operator()(const Point2f& p)const { return p * m; }
|
Point2f operator()(const Point2f& p)const { return p * m; }
|
||||||
};
|
};
|
||||||
|
|
||||||
void cv::ChessBoardGenerator::generateBasis(Point3f& pb1, Point3f& pb2) const
|
void ChessBoardGenerator::generateBasis(Point3f& pb1, Point3f& pb2) const
|
||||||
{
|
{
|
||||||
RNG& rng = theRNG();
|
RNG& rng = theRNG();
|
||||||
|
|
||||||
@ -108,7 +104,7 @@ void cv::ChessBoardGenerator::generateBasis(Point3f& pb1, Point3f& pb2) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Mat cv::ChessBoardGenerator::generateChessBoard(const Mat& bg, const Mat& camMat, const Mat& distCoeffs,
|
Mat ChessBoardGenerator::generateChessBoard(const Mat& bg, const Mat& camMat, const Mat& distCoeffs,
|
||||||
const Point3f& zero, const Point3f& pb1, const Point3f& pb2,
|
const Point3f& zero, const Point3f& pb1, const Point3f& pb2,
|
||||||
float sqWidth, float sqHeight, const vector<Point3f>& whole,
|
float sqWidth, float sqHeight, const vector<Point3f>& whole,
|
||||||
vector<Point2f>& corners) const
|
vector<Point2f>& corners) const
|
||||||
@ -178,7 +174,7 @@ Mat cv::ChessBoardGenerator::generateChessBoard(const Mat& bg, const Mat& camMat
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mat cv::ChessBoardGenerator::operator ()(const Mat& bg, const Mat& camMat, const Mat& distCoeffs, vector<Point2f>& corners) const
|
Mat ChessBoardGenerator::operator ()(const Mat& bg, const Mat& camMat, const Mat& distCoeffs, vector<Point2f>& corners) const
|
||||||
{
|
{
|
||||||
cov = std::min(cov, 0.8);
|
cov = std::min(cov, 0.8);
|
||||||
double fovx, fovy, focalLen;
|
double fovx, fovy, focalLen;
|
||||||
@ -242,7 +238,7 @@ Mat cv::ChessBoardGenerator::operator ()(const Mat& bg, const Mat& camMat, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Mat cv::ChessBoardGenerator::operator ()(const Mat& bg, const Mat& camMat, const Mat& distCoeffs,
|
Mat ChessBoardGenerator::operator ()(const Mat& bg, const Mat& camMat, const Mat& distCoeffs,
|
||||||
const Size2f& squareSize, vector<Point2f>& corners) const
|
const Size2f& squareSize, vector<Point2f>& corners) const
|
||||||
{
|
{
|
||||||
cov = std::min(cov, 0.8);
|
cov = std::min(cov, 0.8);
|
||||||
@ -301,7 +297,7 @@ Mat cv::ChessBoardGenerator::operator ()(const Mat& bg, const Mat& camMat, const
|
|||||||
squareSize.width, squareSize.height, pts3d, corners);
|
squareSize.width, squareSize.height, pts3d, corners);
|
||||||
}
|
}
|
||||||
|
|
||||||
Mat cv::ChessBoardGenerator::operator ()(const Mat& bg, const Mat& camMat, const Mat& distCoeffs,
|
Mat ChessBoardGenerator::operator ()(const Mat& bg, const Mat& camMat, const Mat& distCoeffs,
|
||||||
const Size2f& squareSize, const Point3f& pos, vector<Point2f>& corners) const
|
const Size2f& squareSize, const Point3f& pos, vector<Point2f>& corners) const
|
||||||
{
|
{
|
||||||
cov = std::min(cov, 0.8);
|
cov = std::min(cov, 0.8);
|
||||||
@ -331,3 +327,5 @@ Mat cv::ChessBoardGenerator::operator ()(const Mat& bg, const Mat& camMat, const
|
|||||||
return generateChessBoard(bg, camMat, distCoeffs, zero, pb1, pb2,
|
return generateChessBoard(bg, camMat, distCoeffs, zero, pb1, pb2,
|
||||||
squareSize.width, squareSize.height, pts3d, corners);
|
squareSize.width, squareSize.height, pts3d, corners);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
#ifndef CV_CHESSBOARDGENERATOR_H143KJTVYM389YTNHKFDHJ89NYVMO3VLMEJNTBGUEIYVCM203P
|
#ifndef CV_CHESSBOARDGENERATOR_H143KJTVYM389YTNHKFDHJ89NYVMO3VLMEJNTBGUEIYVCM203P
|
||||||
#define CV_CHESSBOARDGENERATOR_H143KJTVYM389YTNHKFDHJ89NYVMO3VLMEJNTBGUEIYVCM203P
|
#define CV_CHESSBOARDGENERATOR_H143KJTVYM389YTNHKFDHJ89NYVMO3VLMEJNTBGUEIYVCM203P
|
||||||
|
|
||||||
#include "opencv2/calib3d.hpp"
|
|
||||||
|
|
||||||
namespace cv
|
namespace cv
|
||||||
{
|
{
|
||||||
|
|
||||||
|
using std::vector;
|
||||||
|
|
||||||
class ChessBoardGenerator
|
class ChessBoardGenerator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -43,18 +43,14 @@
|
|||||||
#include "test_chessboardgenerator.hpp"
|
#include "test_chessboardgenerator.hpp"
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <limits>
|
|
||||||
#include <numeric>
|
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test { namespace {
|
||||||
using namespace cv;
|
|
||||||
|
|
||||||
#define _L2_ERR
|
#define _L2_ERR
|
||||||
|
|
||||||
//#define DEBUG_CHESSBOARD
|
//#define DEBUG_CHESSBOARD
|
||||||
|
|
||||||
#ifdef DEBUG_CHESSBOARD
|
#ifdef DEBUG_CHESSBOARD
|
||||||
#include "opencv2/highgui.hpp"
|
|
||||||
void show_points( const Mat& gray, const Mat& expected, const vector<Point2f>& actual, bool was_found )
|
void show_points( const Mat& gray, const Mat& expected, const vector<Point2f>& actual, bool was_found )
|
||||||
{
|
{
|
||||||
Mat rgb( gray.size(), CV_8U);
|
Mat rgb( gray.size(), CV_8U);
|
||||||
@ -103,7 +99,7 @@ double calcError(const vector<Point2f>& v, const Mat& u)
|
|||||||
int count_exp = u.cols * u.rows;
|
int count_exp = u.cols * u.rows;
|
||||||
const Point2f* u_data = u.ptr<Point2f>();
|
const Point2f* u_data = u.ptr<Point2f>();
|
||||||
|
|
||||||
double err = numeric_limits<double>::max();
|
double err = std::numeric_limits<double>::max();
|
||||||
for( int k = 0; k < 2; ++k )
|
for( int k = 0; k < 2; ++k )
|
||||||
{
|
{
|
||||||
double err1 = 0;
|
double err1 = 0;
|
||||||
@ -336,19 +332,19 @@ bool validateData(const ChessBoardGenerator& cbg, const Size& imgSz,
|
|||||||
{
|
{
|
||||||
const Point2f& cur = mat(i, j);
|
const Point2f& cur = mat(i, j);
|
||||||
|
|
||||||
tmp = norm( cur - mat(i + 1, j + 1) );
|
tmp = cv::norm(cur - mat(i + 1, j + 1)); // TODO cvtest
|
||||||
if (tmp < minNeibDist)
|
if (tmp < minNeibDist)
|
||||||
tmp = minNeibDist;
|
tmp = minNeibDist;
|
||||||
|
|
||||||
tmp = norm( cur - mat(i - 1, j + 1 ) );
|
tmp = cv::norm(cur - mat(i - 1, j + 1)); // TODO cvtest
|
||||||
if (tmp < minNeibDist)
|
if (tmp < minNeibDist)
|
||||||
tmp = minNeibDist;
|
tmp = minNeibDist;
|
||||||
|
|
||||||
tmp = norm( cur - mat(i + 1, j - 1) );
|
tmp = cv::norm(cur - mat(i + 1, j - 1)); // TODO cvtest
|
||||||
if (tmp < minNeibDist)
|
if (tmp < minNeibDist)
|
||||||
tmp = minNeibDist;
|
tmp = minNeibDist;
|
||||||
|
|
||||||
tmp = norm( cur - mat(i - 1, j - 1) );
|
tmp = cv::norm(cur - mat(i - 1, j - 1)); // TODO cvtest
|
||||||
if (tmp < minNeibDist)
|
if (tmp < minNeibDist)
|
||||||
tmp = minNeibDist;
|
tmp = minNeibDist;
|
||||||
}
|
}
|
||||||
@ -438,7 +434,7 @@ bool CV_ChessboardDetectorTest::checkByGenerator()
|
|||||||
if (found)
|
if (found)
|
||||||
res = false;
|
res = false;
|
||||||
|
|
||||||
Point2f c = std::accumulate(cg.begin(), cg.end(), Point2f(), plus<Point2f>()) * (1.f/cg.size());
|
Point2f c = std::accumulate(cg.begin(), cg.end(), Point2f(), std::plus<Point2f>()) * (1.f/cg.size());
|
||||||
|
|
||||||
Mat_<double> aff(2, 3);
|
Mat_<double> aff(2, 3);
|
||||||
aff << 1.0, 0.0, -(double)c.x, 0.0, 1.0, 0.0;
|
aff << 1.0, 0.0, -(double)c.x, 0.0, 1.0, 0.0;
|
||||||
@ -472,4 +468,5 @@ TEST(Calib3d_AsymmetricCirclesPatternDetector, accuracy) { CV_ChessboardDetector
|
|||||||
TEST(Calib3d_AsymmetricCirclesPatternDetectorWithClustering, accuracy) { CV_ChessboardDetectorTest test( ASYMMETRIC_CIRCLES_GRID, CALIB_CB_CLUSTERING ); test.safe_run(); }
|
TEST(Calib3d_AsymmetricCirclesPatternDetectorWithClustering, accuracy) { CV_ChessboardDetectorTest test( ASYMMETRIC_CIRCLES_GRID, CALIB_CB_CLUSTERING ); test.safe_run(); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
/* End of file. */
|
/* End of file. */
|
||||||
|
@ -43,10 +43,7 @@
|
|||||||
#include "test_chessboardgenerator.hpp"
|
#include "test_chessboardgenerator.hpp"
|
||||||
#include "opencv2/calib3d/calib3d_c.h"
|
#include "opencv2/calib3d/calib3d_c.h"
|
||||||
|
|
||||||
#include <limits>
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace cv;
|
|
||||||
|
|
||||||
class CV_ChessboardDetectorBadArgTest : public cvtest::BadArgTest
|
class CV_ChessboardDetectorBadArgTest : public cvtest::BadArgTest
|
||||||
{
|
{
|
||||||
@ -151,4 +148,5 @@ void CV_ChessboardDetectorBadArgTest::run( int /*start_from */)
|
|||||||
|
|
||||||
TEST(Calib3d_ChessboardDetector, badarg) { CV_ChessboardDetectorBadArgTest test; test.safe_run(); }
|
TEST(Calib3d_ChessboardDetector, badarg) { CV_ChessboardDetectorBadArgTest test; test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
/* End of file. */
|
/* End of file. */
|
||||||
|
@ -43,6 +43,8 @@
|
|||||||
#include "opencv2/imgproc/imgproc_c.h"
|
#include "opencv2/imgproc/imgproc_c.h"
|
||||||
#include "opencv2/calib3d/calib3d_c.h"
|
#include "opencv2/calib3d/calib3d_c.h"
|
||||||
|
|
||||||
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
class CV_ChessboardDetectorTimingTest : public cvtest::BaseTest
|
class CV_ChessboardDetectorTimingTest : public cvtest::BaseTest
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -182,4 +184,5 @@ _exit_:
|
|||||||
|
|
||||||
TEST(Calib3d_ChessboardDetector, timing) { CV_ChessboardDetectorTimingTest test; test.safe_run(); }
|
TEST(Calib3d_ChessboardDetector, timing) { CV_ChessboardDetectorTimingTest test; test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
/* End of file. */
|
/* End of file. */
|
||||||
|
@ -42,8 +42,7 @@
|
|||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Differential
|
class Differential
|
||||||
{
|
{
|
||||||
@ -155,14 +154,14 @@ protected:
|
|||||||
Mat rvec3_exp, tvec3_exp;
|
Mat rvec3_exp, tvec3_exp;
|
||||||
|
|
||||||
Mat rmat1, rmat2;
|
Mat rmat1, rmat2;
|
||||||
Rodrigues(rvec1, rmat1);
|
cv::Rodrigues(rvec1, rmat1); // TODO cvtest
|
||||||
Rodrigues(rvec2, rmat2);
|
cv::Rodrigues(rvec2, rmat2); // TODO cvtest
|
||||||
Rodrigues(rmat2 * rmat1, rvec3_exp);
|
cv::Rodrigues(rmat2 * rmat1, rvec3_exp); // TODO cvtest
|
||||||
|
|
||||||
tvec3_exp = rmat2 * tvec1 + tvec2;
|
tvec3_exp = rmat2 * tvec1 + tvec2;
|
||||||
|
|
||||||
const double thres = 1e-5;
|
const double thres = 1e-5;
|
||||||
if (norm(rvec3_exp, rvec3) > thres || norm(tvec3_exp, tvec3) > thres)
|
if (cv::norm(rvec3_exp, rvec3) > thres || cv::norm(tvec3_exp, tvec3) > thres)
|
||||||
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
||||||
|
|
||||||
const double eps = 1e-3;
|
const double eps = 1e-3;
|
||||||
@ -176,7 +175,7 @@ protected:
|
|||||||
Mat_<double> dr3_dr1, dt3_dr1;
|
Mat_<double> dr3_dr1, dt3_dr1;
|
||||||
diff.dRv1(dr3_dr1, dt3_dr1);
|
diff.dRv1(dr3_dr1, dt3_dr1);
|
||||||
|
|
||||||
if (norm(dr3_dr1, dr3dr1) > thres || norm(dt3_dr1, dt3dr1) > thres)
|
if (cv::norm(dr3_dr1, dr3dr1) > thres || cv::norm(dt3_dr1, dt3dr1) > thres)
|
||||||
{
|
{
|
||||||
ts->printf( cvtest::TS::LOG, "Invalid derivates by r1\n" );
|
ts->printf( cvtest::TS::LOG, "Invalid derivates by r1\n" );
|
||||||
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
||||||
@ -185,7 +184,7 @@ protected:
|
|||||||
Mat_<double> dr3_dr2, dt3_dr2;
|
Mat_<double> dr3_dr2, dt3_dr2;
|
||||||
diff.dRv2(dr3_dr2, dt3_dr2);
|
diff.dRv2(dr3_dr2, dt3_dr2);
|
||||||
|
|
||||||
if (norm(dr3_dr2, dr3dr2) > thres || norm(dt3_dr2, dt3dr2) > thres)
|
if (cv::norm(dr3_dr2, dr3dr2) > thres || cv::norm(dt3_dr2, dt3dr2) > thres)
|
||||||
{
|
{
|
||||||
ts->printf( cvtest::TS::LOG, "Invalid derivates by r2\n" );
|
ts->printf( cvtest::TS::LOG, "Invalid derivates by r2\n" );
|
||||||
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
||||||
@ -194,7 +193,7 @@ protected:
|
|||||||
Mat_<double> dr3_dt1, dt3_dt1;
|
Mat_<double> dr3_dt1, dt3_dt1;
|
||||||
diff.dTv1(dr3_dt1, dt3_dt1);
|
diff.dTv1(dr3_dt1, dt3_dt1);
|
||||||
|
|
||||||
if (norm(dr3_dt1, dr3dt1) > thres || norm(dt3_dt1, dt3dt1) > thres)
|
if (cv::norm(dr3_dt1, dr3dt1) > thres || cv::norm(dt3_dt1, dt3dt1) > thres)
|
||||||
{
|
{
|
||||||
ts->printf( cvtest::TS::LOG, "Invalid derivates by t1\n" );
|
ts->printf( cvtest::TS::LOG, "Invalid derivates by t1\n" );
|
||||||
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
||||||
@ -203,7 +202,7 @@ protected:
|
|||||||
Mat_<double> dr3_dt2, dt3_dt2;
|
Mat_<double> dr3_dt2, dt3_dt2;
|
||||||
diff.dTv2(dr3_dt2, dt3_dt2);
|
diff.dTv2(dr3_dt2, dt3_dt2);
|
||||||
|
|
||||||
if (norm(dr3_dt2, dr3dt2) > thres || norm(dt3_dt2, dt3dt2) > thres)
|
if (cv::norm(dr3_dt2, dr3dt2) > thres || cv::norm(dt3_dt2, dt3dt2) > thres)
|
||||||
{
|
{
|
||||||
ts->printf( cvtest::TS::LOG, "Invalid derivates by t2\n" );
|
ts->printf( cvtest::TS::LOG, "Invalid derivates by t2\n" );
|
||||||
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
||||||
@ -212,3 +211,5 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
TEST(Calib3d_ComposeRT, accuracy) { CV_composeRT_Test test; test.safe_run(); }
|
TEST(Calib3d_ComposeRT, accuracy) { CV_composeRT_Test test; test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -41,11 +41,9 @@
|
|||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "opencv2/imgproc/imgproc_c.h"
|
#include "opencv2/imgproc/imgproc_c.h"
|
||||||
#include <limits>
|
|
||||||
#include "test_chessboardgenerator.hpp"
|
#include "test_chessboardgenerator.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test { namespace {
|
||||||
using namespace cv;
|
|
||||||
|
|
||||||
class CV_ChessboardSubpixelTest : public cvtest::BaseTest
|
class CV_ChessboardSubpixelTest : public cvtest::BaseTest
|
||||||
{
|
{
|
||||||
@ -78,7 +76,7 @@ int calcDistance(const vector<Point2f>& set1, const vector<Point2f>& set2, doubl
|
|||||||
|
|
||||||
for(int j = 0; j < (int)set2.size(); j++)
|
for(int j = 0; j < (int)set2.size(); j++)
|
||||||
{
|
{
|
||||||
double dist = norm(set1[i] - set2[j]);
|
double dist = cv::norm(set1[i] - set2[j]); // TODO cvtest
|
||||||
if(dist < min_dist)
|
if(dist < min_dist)
|
||||||
{
|
{
|
||||||
min_idx = j;
|
min_idx = j;
|
||||||
@ -256,4 +254,5 @@ TEST(Calib3d_CornerSubPix, regression_7204)
|
|||||||
cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
|
cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
/* End of file. */
|
/* End of file. */
|
||||||
|
@ -42,6 +42,8 @@
|
|||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
class CV_DecomposeProjectionMatrixTest : public cvtest::BaseTest
|
class CV_DecomposeProjectionMatrixTest : public cvtest::BaseTest
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -86,7 +88,7 @@ void CV_DecomposeProjectionMatrixTest::run(int start_from)
|
|||||||
rng.fill(rVec, cv::RNG::UNIFORM, -CV_PI, CV_PI);
|
rng.fill(rVec, cv::RNG::UNIFORM, -CV_PI, CV_PI);
|
||||||
|
|
||||||
cv::Matx33d origR;
|
cv::Matx33d origR;
|
||||||
Rodrigues(rVec, origR);
|
cv::Rodrigues(rVec, origR); // TODO cvtest
|
||||||
|
|
||||||
cv::Vec3d origT;
|
cv::Vec3d origT;
|
||||||
rng.fill(origT, cv::RNG::NORMAL, 0, 1);
|
rng.fill(origT, cv::RNG::NORMAL, 0, 1);
|
||||||
@ -111,19 +113,19 @@ void CV_DecomposeProjectionMatrixTest::run(int start_from)
|
|||||||
|
|
||||||
|
|
||||||
const double thresh = 1e-6;
|
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);
|
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
||||||
break;
|
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);
|
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
||||||
break;
|
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);
|
ts->set_failed_test_info(cvtest::TS::FAIL_BAD_ACCURACY);
|
||||||
break;
|
break;
|
||||||
@ -138,3 +140,5 @@ TEST(Calib3d_DecomposeProjectionMatrix, accuracy)
|
|||||||
CV_DecomposeProjectionMatrixTest test;
|
CV_DecomposeProjectionMatrixTest test;
|
||||||
test.safe_run();
|
test.safe_run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -41,10 +41,12 @@
|
|||||||
//M*/
|
//M*/
|
||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include <opencv2/ts/cuda_test.hpp>
|
#include <opencv2/ts/cuda_test.hpp> // EXPECT_MAT_NEAR
|
||||||
#include "../src/fisheye.hpp"
|
#include "../src/fisheye.hpp"
|
||||||
#include "opencv2/videoio.hpp"
|
#include "opencv2/videoio.hpp"
|
||||||
|
|
||||||
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
class fisheyeTest : public ::testing::Test {
|
class fisheyeTest : public ::testing::Test {
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -701,3 +703,5 @@ void fisheyeTest::merge4(const cv::Mat& tl, const cv::Mat& tr, const cv::Mat& bl
|
|||||||
bl.copyTo(merged(cv::Rect(0, sz.height, sz.width, sz.height)));
|
bl.copyTo(merged(cv::Rect(0, sz.height, sz.width, sz.height)));
|
||||||
br.copyTo(merged(cv::Rect(sz.width, sz.height, sz.width, sz.height)));
|
br.copyTo(merged(cv::Rect(sz.width, sz.height, sz.width, sz.height)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -42,10 +42,9 @@
|
|||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "opencv2/calib3d/calib3d_c.h"
|
#include "opencv2/calib3d/calib3d_c.h"
|
||||||
|
|
||||||
using namespace cv;
|
namespace cvtest {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int cvTsRodrigues( const CvMat* src, CvMat* dst, CvMat* jacobian )
|
static int cvTsRodrigues( const CvMat* src, CvMat* dst, CvMat* jacobian )
|
||||||
{
|
{
|
||||||
int depth;
|
int depth;
|
||||||
int i;
|
int i;
|
||||||
@ -348,14 +347,18 @@ int cvTsRodrigues( const CvMat* src, CvMat* dst, CvMat* jacobian )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void cvtest::Rodrigues(const Mat& src, Mat& dst, Mat* jac)
|
/*extern*/ void Rodrigues(const Mat& src, Mat& dst, Mat* jac)
|
||||||
{
|
{
|
||||||
|
CV_Assert(src.data != dst.data && "Inplace is not supported");
|
||||||
|
CV_Assert(!dst.empty() && "'dst' must be allocated");
|
||||||
CvMat _src = src, _dst = dst, _jac;
|
CvMat _src = src, _dst = dst, _jac;
|
||||||
if( jac )
|
if( jac )
|
||||||
_jac = *jac;
|
_jac = *jac;
|
||||||
cvTsRodrigues(&_src, &_dst, jac ? &_jac : 0);
|
cvTsRodrigues(&_src, &_dst, jac ? &_jac : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
namespace opencv_test {
|
||||||
|
|
||||||
static void test_convertHomogeneous( const Mat& _src, Mat& _dst )
|
static void test_convertHomogeneous( const Mat& _src, Mat& _dst )
|
||||||
{
|
{
|
||||||
@ -463,6 +466,7 @@ static void test_convertHomogeneous( const Mat& _src, Mat& _dst )
|
|||||||
dst.convertTo(_dst, _dst.depth());
|
dst.convertTo(_dst, _dst.depth());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
void
|
void
|
||||||
test_projectPoints( const Mat& _3d, const Mat& Rt, const Mat& A, Mat& _2d, RNG* rng, double sigma )
|
test_projectPoints( const Mat& _3d, const Mat& Rt, const Mat& A, Mat& _2d, RNG* rng, double sigma )
|
||||||
@ -728,7 +732,7 @@ void CV_RodriguesTest::prepare_to_validation( int /*test_case_idx*/ )
|
|||||||
cvtest::Rodrigues( m, vec2, m2v_jac );
|
cvtest::Rodrigues( m, vec2, m2v_jac );
|
||||||
cvtest::copy( vec, vec2 );
|
cvtest::copy( vec, vec2 );
|
||||||
|
|
||||||
theta0 = norm( vec2, CV_L2 );
|
theta0 = cvtest::norm( vec2, CV_L2 );
|
||||||
theta1 = fmod( theta0, CV_PI*2 );
|
theta1 = fmod( theta0, CV_PI*2 );
|
||||||
|
|
||||||
if( theta1 > CV_PI )
|
if( theta1 > CV_PI )
|
||||||
@ -1067,7 +1071,9 @@ protected:
|
|||||||
void run_func();
|
void run_func();
|
||||||
void prepare_to_validation( int );
|
void prepare_to_validation( int );
|
||||||
|
|
||||||
|
#if 0
|
||||||
double sampson_error(const double* f, double x1, double y1, double x2, double y2);
|
double sampson_error(const double* f, double x1, double y1, double x2, double y2);
|
||||||
|
#endif
|
||||||
|
|
||||||
int method;
|
int method;
|
||||||
int img_size;
|
int img_size;
|
||||||
@ -1299,6 +1305,7 @@ void CV_EssentialMatTest::run_func()
|
|||||||
mask2.copyTo(test_mat[TEMP][4]);
|
mask2.copyTo(test_mat[TEMP][4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
double CV_EssentialMatTest::sampson_error(const double * f, double x1, double y1, double x2, double y2)
|
double CV_EssentialMatTest::sampson_error(const double * f, double x1, double y1, double x2, double y2)
|
||||||
{
|
{
|
||||||
double Fx1[3] = {
|
double Fx1[3] = {
|
||||||
@ -1316,8 +1323,8 @@ double CV_EssentialMatTest::sampson_error(const double * f, double x1, double y1
|
|||||||
double error = x2tFx1 * x2tFx1 / (Fx1[0] * Fx1[0] + Fx1[1] * Fx1[1] + Ftx2[0] * Ftx2[0] + Ftx2[1] * Ftx2[1]);
|
double error = x2tFx1 * x2tFx1 / (Fx1[0] * Fx1[0] + Fx1[1] * Fx1[1] + Ftx2[0] * Ftx2[0] + Ftx2[1] * Ftx2[1]);
|
||||||
error = sqrt(error);
|
error = sqrt(error);
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void CV_EssentialMatTest::prepare_to_validation( int test_case_idx )
|
void CV_EssentialMatTest::prepare_to_validation( int test_case_idx )
|
||||||
{
|
{
|
||||||
@ -1395,10 +1402,10 @@ void CV_EssentialMatTest::prepare_to_validation( int test_case_idx )
|
|||||||
|
|
||||||
double* pose_prop1 = test_mat[REF_OUTPUT][2].ptr<double>();
|
double* pose_prop1 = test_mat[REF_OUTPUT][2].ptr<double>();
|
||||||
double* pose_prop2 = test_mat[OUTPUT][2].ptr<double>();
|
double* pose_prop2 = test_mat[OUTPUT][2].ptr<double>();
|
||||||
double terr1 = cvtest::norm(Rt0.col(3) / norm(Rt0.col(3)) + test_mat[TEMP][3], NORM_L2);
|
double terr1 = cvtest::norm(Rt0.col(3) / cvtest::norm(Rt0.col(3), NORM_L2) + test_mat[TEMP][3], NORM_L2);
|
||||||
double terr2 = cvtest::norm(Rt0.col(3) / norm(Rt0.col(3)) - test_mat[TEMP][3], NORM_L2);
|
double terr2 = cvtest::norm(Rt0.col(3) / cvtest::norm(Rt0.col(3), NORM_L2) - test_mat[TEMP][3], NORM_L2);
|
||||||
Mat rvec;
|
Mat rvec(3, 1, CV_32F);
|
||||||
Rodrigues(Rt0.colRange(0, 3), rvec);
|
cvtest::Rodrigues(Rt0.colRange(0, 3), rvec);
|
||||||
pose_prop1[0] = 0;
|
pose_prop1[0] = 0;
|
||||||
// No check for CV_LMeDS on translation. Since it
|
// No check for CV_LMeDS on translation. Since it
|
||||||
// involves with some degraded problem, when data is exact inliers.
|
// involves with some degraded problem, when data is exact inliers.
|
||||||
@ -1726,4 +1733,5 @@ TEST(Calib3d_FindFundamentalMat, correctMatches)
|
|||||||
cout << np2 << endl;
|
cout << np2 << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
/* End of file. */
|
/* End of file. */
|
||||||
|
@ -42,7 +42,8 @@
|
|||||||
//M*/
|
//M*/
|
||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include <time.h>
|
|
||||||
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
#define CALIB3D_HOMOGRAPHY_ERROR_MATRIX_SIZE 1
|
#define CALIB3D_HOMOGRAPHY_ERROR_MATRIX_SIZE 1
|
||||||
#define CALIB3D_HOMOGRAPHY_ERROR_MATRIX_DIFF 2
|
#define CALIB3D_HOMOGRAPHY_ERROR_MATRIX_DIFF 2
|
||||||
@ -622,7 +623,7 @@ TEST(Calib3d_Homography, EKcase)
|
|||||||
Mat h = findHomography(p1, p2, RANSAC, 0.01, mask);
|
Mat h = findHomography(p1, p2, RANSAC, 0.01, mask);
|
||||||
ASSERT_TRUE(!h.empty());
|
ASSERT_TRUE(!h.empty());
|
||||||
|
|
||||||
transpose(mask, mask);
|
cv::transpose(mask, mask);
|
||||||
Mat p3, mask2;
|
Mat p3, mask2;
|
||||||
int ninliers = countNonZero(mask);
|
int ninliers = countNonZero(mask);
|
||||||
Mat nmask[] = { mask, mask };
|
Mat nmask[] = { mask, mask };
|
||||||
@ -631,7 +632,7 @@ TEST(Calib3d_Homography, EKcase)
|
|||||||
mask2 = mask2.reshape(1);
|
mask2 = mask2.reshape(1);
|
||||||
p2 = p2.reshape(1);
|
p2 = p2.reshape(1);
|
||||||
p3 = p3.reshape(1);
|
p3 = p3.reshape(1);
|
||||||
double err = norm(p2, p3, NORM_INF, mask2);
|
double err = cvtest::norm(p2, p3, NORM_INF, mask2);
|
||||||
|
|
||||||
printf("ninliers: %d, inliers err: %.2g\n", ninliers, err);
|
printf("ninliers: %d, inliers err: %.2g\n", ninliers, err);
|
||||||
ASSERT_GE(ninliers, 10);
|
ASSERT_GE(ninliers, 10);
|
||||||
@ -709,3 +710,5 @@ TEST(Calib3d_Homography, fromImages)
|
|||||||
ASSERT_TRUE(!H1.empty());
|
ASSERT_TRUE(!H1.empty());
|
||||||
ASSERT_GE(ninliers1, 80);
|
ASSERT_GE(ninliers1, 80);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -44,11 +44,8 @@
|
|||||||
//M*/
|
//M*/
|
||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "opencv2/calib3d.hpp"
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class CV_HomographyDecompTest: public cvtest::BaseTest {
|
class CV_HomographyDecompTest: public cvtest::BaseTest {
|
||||||
|
|
||||||
@ -118,9 +115,9 @@ private:
|
|||||||
riter != rotations.end() && titer != translations.end() && niter != normals.end();
|
riter != rotations.end() && titer != translations.end() && niter != normals.end();
|
||||||
++riter, ++titer, ++niter) {
|
++riter, ++titer, ++niter) {
|
||||||
|
|
||||||
double rdist = norm(*riter, _R, NORM_INF);
|
double rdist = cvtest::norm(*riter, _R, NORM_INF);
|
||||||
double tdist = norm(*titer, _t, NORM_INF);
|
double tdist = cvtest::norm(*titer, _t, NORM_INF);
|
||||||
double ndist = norm(*niter, _n, NORM_INF);
|
double ndist = cvtest::norm(*niter, _n, NORM_INF);
|
||||||
|
|
||||||
if ( rdist < max_error
|
if ( rdist < max_error
|
||||||
&& tdist < max_error
|
&& tdist < max_error
|
||||||
@ -136,3 +133,5 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
TEST(Calib3d_DecomposeHomography, regression) { CV_HomographyDecompTest test; test.safe_run(); }
|
TEST(Calib3d_DecomposeHomography, regression) { CV_HomographyDecompTest test; test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
CV_TEST_MAIN("")
|
CV_TEST_MAIN("")
|
||||||
|
@ -42,8 +42,7 @@
|
|||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "opencv2/calib3d/calib3d_c.h"
|
#include "opencv2/calib3d/calib3d_c.h"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class CV_POSITTest : public cvtest::BaseTest
|
class CV_POSITTest : public cvtest::BaseTest
|
||||||
{
|
{
|
||||||
@ -219,4 +218,5 @@ void CV_POSITTest::run( int start_from )
|
|||||||
|
|
||||||
TEST(Calib3d_POSIT, accuracy) { CV_POSITTest test; test.safe_run(); }
|
TEST(Calib3d_POSIT, accuracy) { CV_POSITTest test; test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
/* End of file. */
|
/* End of file. */
|
||||||
|
@ -1,23 +1,22 @@
|
|||||||
#ifdef __GNUC__
|
// This file is part of OpenCV project.
|
||||||
# pragma GCC diagnostic ignored "-Wmissing-declarations"
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
# if defined __clang__ || defined __APPLE__
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
# pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
|
||||||
# pragma GCC diagnostic ignored "-Wextra"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __OPENCV_TEST_PRECOMP_HPP__
|
#ifndef __OPENCV_TEST_PRECOMP_HPP__
|
||||||
#define __OPENCV_TEST_PRECOMP_HPP__
|
#define __OPENCV_TEST_PRECOMP_HPP__
|
||||||
|
|
||||||
#include <iostream>
|
#include <functional>
|
||||||
|
#include <numeric>
|
||||||
|
|
||||||
#include "opencv2/ts.hpp"
|
#include "opencv2/ts.hpp"
|
||||||
#include "opencv2/imgproc.hpp"
|
|
||||||
#include "opencv2/calib3d.hpp"
|
#include "opencv2/calib3d.hpp"
|
||||||
#include "opencv2/imgcodecs.hpp"
|
|
||||||
|
|
||||||
namespace cvtest
|
namespace cvtest
|
||||||
{
|
{
|
||||||
void Rodrigues(const Mat& src, Mat& dst, Mat* jac=0);
|
void Rodrigues(const Mat& src, Mat& dst, Mat* jac=0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace opencv_test {
|
||||||
|
CVTEST_GUARD_SYMBOL(Rodrigues)
|
||||||
|
} // namespace
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -42,11 +42,8 @@
|
|||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "opencv2/calib3d/calib3d_c.h"
|
#include "opencv2/calib3d/calib3d_c.h"
|
||||||
#include <string>
|
|
||||||
#include <limits>
|
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
template<class T> double thres() { return 1.0; }
|
template<class T> double thres() { return 1.0; }
|
||||||
template<> double thres<float>() { return 1e-5; }
|
template<> double thres<float>() { return 1e-5; }
|
||||||
@ -130,7 +127,7 @@ protected:
|
|||||||
CvMat cvdisp = disp; CvMat cv_3dImg = _3dImg; CvMat cvQ = Q;
|
CvMat cvdisp = disp; CvMat cv_3dImg = _3dImg; CvMat cvQ = Q;
|
||||||
cvReprojectImageTo3D( &cvdisp, &cv_3dImg, &cvQ, handleMissingValues );
|
cvReprojectImageTo3D( &cvdisp, &cv_3dImg, &cvQ, handleMissingValues );
|
||||||
|
|
||||||
if (numeric_limits<OutT>::max() == numeric_limits<float>::max())
|
if (std::numeric_limits<OutT>::max() == std::numeric_limits<float>::max())
|
||||||
reprojectImageTo3D(disp, _3dImg, Q, handleMissingValues);
|
reprojectImageTo3D(disp, _3dImg, Q, handleMissingValues);
|
||||||
|
|
||||||
for(int y = 0; y < disp.rows; ++y)
|
for(int y = 0; y < disp.rows; ++y)
|
||||||
@ -178,3 +175,5 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
TEST(Calib3d_ReprojectImageTo3D, accuracy) { CV_ReprojectImageTo3DTest test; test.safe_run(); }
|
TEST(Calib3d_ReprojectImageTo3D, accuracy) { CV_ReprojectImageTo3DTest test; test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -42,12 +42,7 @@
|
|||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
#ifdef HAVE_TBB
|
namespace opencv_test { namespace {
|
||||||
#include "tbb/task_scheduler_init.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace cv;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class CV_solvePnPRansac_Test : public cvtest::BaseTest
|
class CV_solvePnPRansac_Test : public cvtest::BaseTest
|
||||||
{
|
{
|
||||||
@ -69,7 +64,7 @@ protected:
|
|||||||
Point3f pmin = Point3f(-1, -1, 5),
|
Point3f pmin = Point3f(-1, -1, 5),
|
||||||
Point3f pmax = Point3f(1, 1, 10))
|
Point3f pmax = Point3f(1, 1, 10))
|
||||||
{
|
{
|
||||||
RNG rng = ::theRNG(); // fix the seed to use "fixed" input 3D points
|
RNG rng = cv::theRNG(); // fix the seed to use "fixed" input 3D points
|
||||||
|
|
||||||
for (size_t i = 0; i < points.size(); i++)
|
for (size_t i = 0; i < points.size(); i++)
|
||||||
{
|
{
|
||||||
@ -142,7 +137,7 @@ protected:
|
|||||||
|
|
||||||
bool isTestSuccess = inliers.size() >= points.size()*0.95;
|
bool isTestSuccess = inliers.size() >= points.size()*0.95;
|
||||||
|
|
||||||
double rvecDiff = norm(rvec-trueRvec), tvecDiff = norm(tvec-trueTvec);
|
double rvecDiff = cvtest::norm(rvec, trueRvec, NORM_L2), tvecDiff = cvtest::norm(tvec, trueTvec, NORM_L2);
|
||||||
isTestSuccess = isTestSuccess && rvecDiff < epsilon[method] && tvecDiff < epsilon[method];
|
isTestSuccess = isTestSuccess && rvecDiff < epsilon[method] && tvecDiff < epsilon[method];
|
||||||
double error = rvecDiff > tvecDiff ? rvecDiff : tvecDiff;
|
double error = rvecDiff > tvecDiff ? rvecDiff : tvecDiff;
|
||||||
//cout << error << " " << inliers.size() << " " << eps[method] << endl;
|
//cout << error << " " << inliers.size() << " " << eps[method] << endl;
|
||||||
@ -254,7 +249,7 @@ protected:
|
|||||||
return isEstimateSuccess;
|
return isEstimateSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
double rvecDiff = norm(rvec-trueRvec), tvecDiff = norm(tvec-trueTvec);
|
double rvecDiff = cvtest::norm(rvec, trueRvec, NORM_L2), tvecDiff = cvtest::norm(tvec, trueTvec, NORM_L2);
|
||||||
bool isTestSuccess = rvecDiff < epsilon[method] && tvecDiff < epsilon[method];
|
bool isTestSuccess = rvecDiff < epsilon[method] && tvecDiff < epsilon[method];
|
||||||
|
|
||||||
double error = rvecDiff > tvecDiff ? rvecDiff : tvecDiff;
|
double error = rvecDiff > tvecDiff ? rvecDiff : tvecDiff;
|
||||||
@ -305,8 +300,8 @@ class CV_solveP3P_Test : public CV_solvePnPRansac_Test
|
|||||||
bool isTestSuccess = false;
|
bool isTestSuccess = false;
|
||||||
double error = DBL_MAX;
|
double error = DBL_MAX;
|
||||||
for (unsigned int i = 0; i < rvecs.size() && !isTestSuccess; ++i) {
|
for (unsigned int i = 0; i < rvecs.size() && !isTestSuccess; ++i) {
|
||||||
double rvecDiff = norm(rvecs[i]-trueRvec);
|
double rvecDiff = cvtest::norm(rvecs[i], trueRvec, NORM_L2);
|
||||||
double tvecDiff = norm(tvecs[i]-trueTvec);
|
double tvecDiff = cvtest::norm(tvecs[i], trueTvec, NORM_L2);
|
||||||
isTestSuccess = rvecDiff < epsilon[method] && tvecDiff < epsilon[method];
|
isTestSuccess = rvecDiff < epsilon[method] && tvecDiff < epsilon[method];
|
||||||
error = std::min(error, std::max(rvecDiff, tvecDiff));
|
error = std::min(error, std::max(rvecDiff, tvecDiff));
|
||||||
}
|
}
|
||||||
@ -450,12 +445,12 @@ TEST(Calib3d_SolvePnPRansac, input_type)
|
|||||||
points2dMat = points2dMat.reshape(1, numPoints);
|
points2dMat = points2dMat.reshape(1, numPoints);
|
||||||
EXPECT_TRUE(solvePnPRansac(points3dMat, points2dMat, intrinsics, cv::Mat(), R4, t4));
|
EXPECT_TRUE(solvePnPRansac(points3dMat, points2dMat, intrinsics, cv::Mat(), R4, t4));
|
||||||
|
|
||||||
EXPECT_LE(norm(R1, R2, NORM_INF), 1e-6);
|
EXPECT_LE(cvtest::norm(R1, R2, NORM_INF), 1e-6);
|
||||||
EXPECT_LE(norm(t1, t2, NORM_INF), 1e-6);
|
EXPECT_LE(cvtest::norm(t1, t2, NORM_INF), 1e-6);
|
||||||
EXPECT_LE(norm(R1, R3, NORM_INF), 1e-6);
|
EXPECT_LE(cvtest::norm(R1, R3, NORM_INF), 1e-6);
|
||||||
EXPECT_LE(norm(t1, t3, NORM_INF), 1e-6);
|
EXPECT_LE(cvtest::norm(t1, t3, NORM_INF), 1e-6);
|
||||||
EXPECT_LE(norm(R1, R4, NORM_INF), 1e-6);
|
EXPECT_LE(cvtest::norm(R1, R4, NORM_INF), 1e-6);
|
||||||
EXPECT_LE(norm(t1, t4, NORM_INF), 1e-6);
|
EXPECT_LE(cvtest::norm(t1, t4, NORM_INF), 1e-6);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(Calib3d_SolvePnP, double_support)
|
TEST(Calib3d_SolvePnP, double_support)
|
||||||
@ -483,8 +478,8 @@ TEST(Calib3d_SolvePnP, double_support)
|
|||||||
solvePnPRansac(points3dF, points2dF, intrinsics, cv::Mat(), RF, tF, true, 100, 8.f, 0.999, inliers, cv::SOLVEPNP_P3P);
|
solvePnPRansac(points3dF, points2dF, intrinsics, cv::Mat(), RF, tF, true, 100, 8.f, 0.999, inliers, cv::SOLVEPNP_P3P);
|
||||||
solvePnPRansac(points3d, points2d, intrinsics, cv::Mat(), R, t, true, 100, 8.f, 0.999, inliers, cv::SOLVEPNP_P3P);
|
solvePnPRansac(points3d, points2d, intrinsics, cv::Mat(), R, t, true, 100, 8.f, 0.999, inliers, cv::SOLVEPNP_P3P);
|
||||||
|
|
||||||
EXPECT_LE(norm(R, Mat_<double>(RF), NORM_INF), 1e-3);
|
EXPECT_LE(cvtest::norm(R, Mat_<double>(RF), NORM_INF), 1e-3);
|
||||||
EXPECT_LE(norm(t, Mat_<double>(tF), NORM_INF), 1e-3);
|
EXPECT_LE(cvtest::norm(t, Mat_<double>(tF), NORM_INF), 1e-3);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(Calib3d_SolvePnP, translation)
|
TEST(Calib3d_SolvePnP, translation)
|
||||||
@ -556,8 +551,8 @@ TEST(Calib3d_SolvePnP, iterativeInitialGuess3pts)
|
|||||||
std::cout << "tvec_ground_truth: " << tvec_ground_truth.t() << std::endl;
|
std::cout << "tvec_ground_truth: " << tvec_ground_truth.t() << std::endl;
|
||||||
std::cout << "tvec_est: " << tvec_est.t() << std::endl;
|
std::cout << "tvec_est: " << tvec_est.t() << std::endl;
|
||||||
|
|
||||||
EXPECT_LE(norm(rvec_ground_truth, rvec_est, NORM_INF), 1e-6);
|
EXPECT_LE(cvtest::norm(rvec_ground_truth, rvec_est, NORM_INF), 1e-6);
|
||||||
EXPECT_LE(norm(tvec_ground_truth, tvec_est, NORM_INF), 1e-6);
|
EXPECT_LE(cvtest::norm(tvec_ground_truth, tvec_est, NORM_INF), 1e-6);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -587,7 +582,9 @@ TEST(Calib3d_SolvePnP, iterativeInitialGuess3pts)
|
|||||||
std::cout << "tvec_ground_truth: " << tvec_ground_truth.t() << std::endl;
|
std::cout << "tvec_ground_truth: " << tvec_ground_truth.t() << std::endl;
|
||||||
std::cout << "tvec_est: " << tvec_est.t() << std::endl;
|
std::cout << "tvec_est: " << tvec_est.t() << std::endl;
|
||||||
|
|
||||||
EXPECT_LE(norm(rvec_ground_truth, rvec_est, NORM_INF), 1e-6);
|
EXPECT_LE(cvtest::norm(rvec_ground_truth, rvec_est, NORM_INF), 1e-6);
|
||||||
EXPECT_LE(norm(tvec_ground_truth, tvec_est, NORM_INF), 1e-6);
|
EXPECT_LE(cvtest::norm(tvec_ground_truth, tvec_est, NORM_INF), 1e-6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -46,12 +46,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include <limits>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test { namespace {
|
||||||
using namespace cv;
|
|
||||||
|
|
||||||
const float EVAL_BAD_THRESH = 1.f;
|
const float EVAL_BAD_THRESH = 1.f;
|
||||||
const int EVAL_TEXTURELESS_WIDTH = 3;
|
const int EVAL_TEXTURELESS_WIDTH = 3;
|
||||||
@ -238,10 +234,10 @@ void computeDepthDiscontMask( const Mat& disp, Mat& depthDiscontMask, const Mat&
|
|||||||
|
|
||||||
Mat curDisp; disp.copyTo( curDisp );
|
Mat curDisp; disp.copyTo( curDisp );
|
||||||
if( !unknDispMask.empty() )
|
if( !unknDispMask.empty() )
|
||||||
curDisp.setTo( Scalar(numeric_limits<float>::min()), unknDispMask );
|
curDisp.setTo( Scalar(std::numeric_limits<float>::min()), unknDispMask );
|
||||||
Mat maxNeighbDisp; dilate( curDisp, maxNeighbDisp, Mat(3, 3, CV_8UC1, Scalar(1)) );
|
Mat maxNeighbDisp; dilate( curDisp, maxNeighbDisp, Mat(3, 3, CV_8UC1, Scalar(1)) );
|
||||||
if( !unknDispMask.empty() )
|
if( !unknDispMask.empty() )
|
||||||
curDisp.setTo( Scalar(numeric_limits<float>::max()), unknDispMask );
|
curDisp.setTo( Scalar(std::numeric_limits<float>::max()), unknDispMask );
|
||||||
Mat minNeighbDisp; erode( curDisp, minNeighbDisp, Mat(3, 3, CV_8UC1, Scalar(1)) );
|
Mat minNeighbDisp; erode( curDisp, minNeighbDisp, Mat(3, 3, CV_8UC1, Scalar(1)) );
|
||||||
depthDiscontMask = max( (Mat)(maxNeighbDisp-disp), (Mat)(disp-minNeighbDisp) ) > dispGap;
|
depthDiscontMask = max( (Mat)(maxNeighbDisp-disp), (Mat)(disp-minNeighbDisp) ) > dispGap;
|
||||||
if( !unknDispMask.empty() )
|
if( !unknDispMask.empty() )
|
||||||
@ -566,12 +562,12 @@ int CV_StereoMatchingTest::processStereoMatchingResults( FileStorage& fs, int ca
|
|||||||
Mat leftUnknMask, rightUnknMask;
|
Mat leftUnknMask, rightUnknMask;
|
||||||
DatasetParams params = datasetsParams[caseDatasets[caseIdx]];
|
DatasetParams params = datasetsParams[caseDatasets[caseIdx]];
|
||||||
absdiff( trueLeftDisp, Scalar(params.dispUnknVal), leftUnknMask );
|
absdiff( trueLeftDisp, Scalar(params.dispUnknVal), leftUnknMask );
|
||||||
leftUnknMask = leftUnknMask < numeric_limits<float>::epsilon();
|
leftUnknMask = leftUnknMask < std::numeric_limits<float>::epsilon();
|
||||||
assert(leftUnknMask.type() == CV_8UC1);
|
assert(leftUnknMask.type() == CV_8UC1);
|
||||||
if( !trueRightDisp.empty() )
|
if( !trueRightDisp.empty() )
|
||||||
{
|
{
|
||||||
absdiff( trueRightDisp, Scalar(params.dispUnknVal), rightUnknMask );
|
absdiff( trueRightDisp, Scalar(params.dispUnknVal), rightUnknMask );
|
||||||
rightUnknMask = rightUnknMask < numeric_limits<float>::epsilon();
|
rightUnknMask = rightUnknMask < std::numeric_limits<float>::epsilon();
|
||||||
assert(rightUnknMask.type() == CV_8UC1);
|
assert(rightUnknMask.type() == CV_8UC1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -892,3 +888,5 @@ TEST(Calib3d_StereoSGBM_HH4, regression)
|
|||||||
absdiff(toCheck, testData,diff);
|
absdiff(toCheck, testData,diff);
|
||||||
CV_Assert( countNonZero(diff)==0);
|
CV_Assert( countNonZero(diff)==0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -43,8 +43,7 @@
|
|||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "opencv2/imgproc/imgproc_c.h"
|
#include "opencv2/imgproc/imgproc_c.h"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class CV_DefaultNewCameraMatrixTest : public cvtest::ArrayTest
|
class CV_DefaultNewCameraMatrixTest : public cvtest::ArrayTest
|
||||||
{
|
{
|
||||||
@ -67,7 +66,7 @@ private:
|
|||||||
|
|
||||||
static const int MAX_X = 2048;
|
static const int MAX_X = 2048;
|
||||||
static const int MAX_Y = 2048;
|
static const int MAX_Y = 2048;
|
||||||
static const int MAX_VAL = 10000;
|
//static const int MAX_VAL = 10000;
|
||||||
};
|
};
|
||||||
|
|
||||||
CV_DefaultNewCameraMatrixTest::CV_DefaultNewCameraMatrixTest()
|
CV_DefaultNewCameraMatrixTest::CV_DefaultNewCameraMatrixTest()
|
||||||
@ -938,3 +937,5 @@ double CV_InitUndistortRectifyMapTest::get_success_error_level( int /*test_case_
|
|||||||
TEST(Calib3d_DefaultNewCameraMatrix, accuracy) { CV_DefaultNewCameraMatrixTest test; test.safe_run(); }
|
TEST(Calib3d_DefaultNewCameraMatrix, accuracy) { CV_DefaultNewCameraMatrixTest test; test.safe_run(); }
|
||||||
TEST(Calib3d_UndistortPoints, accuracy) { CV_UndistortPointsTest test; test.safe_run(); }
|
TEST(Calib3d_UndistortPoints, accuracy) { CV_UndistortPointsTest test; test.safe_run(); }
|
||||||
TEST(Calib3d_InitUndistortRectifyMap, accuracy) { CV_InitUndistortRectifyMapTest test; test.safe_run(); }
|
TEST(Calib3d_InitUndistortRectifyMap, accuracy) { CV_InitUndistortRectifyMapTest test; test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -42,6 +42,8 @@
|
|||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "opencv2/imgproc/imgproc_c.h"
|
#include "opencv2/imgproc/imgproc_c.h"
|
||||||
|
|
||||||
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
class CV_UndistortPointsBadArgTest : public cvtest::BadArgTest
|
class CV_UndistortPointsBadArgTest : public cvtest::BadArgTest
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -525,4 +527,5 @@ TEST(Calib3d_UndistortPoints, badarg) { CV_UndistortPointsBadArgTest test; test.
|
|||||||
TEST(Calib3d_InitUndistortRectifyMap, badarg) { CV_InitUndistortRectifyMapBadArgTest test; test.safe_run(); }
|
TEST(Calib3d_InitUndistortRectifyMap, badarg) { CV_InitUndistortRectifyMapBadArgTest test; test.safe_run(); }
|
||||||
TEST(Calib3d_Undistort, badarg) { CV_UndistortBadArgTest test; test.safe_run(); }
|
TEST(Calib3d_Undistort, badarg) { CV_UndistortBadArgTest test; test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
/* End of file. */
|
/* End of file. */
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class CV_UndistortTest : public cvtest::BaseTest
|
class CV_UndistortTest : public cvtest::BaseTest
|
||||||
{
|
{
|
||||||
@ -29,7 +30,7 @@ CV_UndistortTest::~CV_UndistortTest() {}
|
|||||||
|
|
||||||
void CV_UndistortTest::generate3DPointCloud(vector<Point3f>& points, Point3f pmin, Point3f pmax)
|
void CV_UndistortTest::generate3DPointCloud(vector<Point3f>& points, Point3f pmin, Point3f pmax)
|
||||||
{
|
{
|
||||||
RNG rng_Point = ::theRNG(); // fix the seed to use "fixed" input 3D points
|
RNG rng_Point = cv::theRNG(); // fix the seed to use "fixed" input 3D points
|
||||||
for (size_t i = 0; i < points.size(); i++)
|
for (size_t i = 0; i < points.size(); i++)
|
||||||
{
|
{
|
||||||
float _x = rng_Point.uniform(pmin.x, pmax.x);
|
float _x = rng_Point.uniform(pmin.x, pmax.x);
|
||||||
@ -117,3 +118,5 @@ TEST(Calib3d_Undistort, stop_criteria)
|
|||||||
|
|
||||||
ASSERT_LE(obtainedError, maxError);
|
ASSERT_LE(obtainedError, maxError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
#include "opencv2/core/cuda.hpp"
|
#include "opencv2/core/cuda.hpp"
|
||||||
#include "opencv2/ts/cuda_perf.hpp"
|
#include "opencv2/ts/cuda_perf.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test { namespace {
|
||||||
using namespace testing;
|
using namespace testing;
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
|
|
||||||
@ -193,4 +193,5 @@ PERF_TEST_P(Sz_2Depth, CUDA_GpuMat_ConvertTo,
|
|||||||
SANITY_CHECK_NOTHING();
|
SANITY_CHECK_NOTHING();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
#endif
|
#endif
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
///////////// Lut ////////////////////////
|
///////////// Lut ////////////////////////
|
||||||
@ -352,7 +352,7 @@ enum
|
|||||||
|
|
||||||
CV_ENUM(FlipType, FLIP_BOTH, FLIP_ROWS, FLIP_COLS)
|
CV_ENUM(FlipType, FLIP_BOTH, FLIP_ROWS, FLIP_COLS)
|
||||||
|
|
||||||
typedef std::tr1::tuple<Size, MatType, FlipType> FlipParams;
|
typedef tuple<Size, MatType, FlipType> FlipParams;
|
||||||
typedef TestBaseWithParam<FlipParams> FlipFixture;
|
typedef TestBaseWithParam<FlipParams> FlipFixture;
|
||||||
|
|
||||||
OCL_PERF_TEST_P(FlipFixture, Flip,
|
OCL_PERF_TEST_P(FlipFixture, Flip,
|
||||||
@ -570,7 +570,7 @@ OCL_PERF_TEST_P(BitwiseNotFixture, Bitwise_not,
|
|||||||
|
|
||||||
CV_ENUM(CmpCode, CMP_LT, CMP_LE, CMP_EQ, CMP_NE, CMP_GE, CMP_GT)
|
CV_ENUM(CmpCode, CMP_LT, CMP_LE, CMP_EQ, CMP_NE, CMP_GE, CMP_GT)
|
||||||
|
|
||||||
typedef std::tr1::tuple<Size, MatType, CmpCode> CompareParams;
|
typedef tuple<Size, MatType, CmpCode> CompareParams;
|
||||||
typedef TestBaseWithParam<CompareParams> CompareFixture;
|
typedef TestBaseWithParam<CompareParams> CompareFixture;
|
||||||
|
|
||||||
OCL_PERF_TEST_P(CompareFixture, Compare,
|
OCL_PERF_TEST_P(CompareFixture, Compare,
|
||||||
@ -773,7 +773,7 @@ OCL_PERF_TEST_P(MeanStdDevFixture, MeanStdDevWithMask,
|
|||||||
|
|
||||||
CV_ENUM(NormType, NORM_INF, NORM_L1, NORM_L2)
|
CV_ENUM(NormType, NORM_INF, NORM_L1, NORM_L2)
|
||||||
|
|
||||||
typedef std::tr1::tuple<Size, MatType, NormType> NormParams;
|
typedef tuple<Size, MatType, NormType> NormParams;
|
||||||
typedef TestBaseWithParam<NormParams> NormFixture;
|
typedef TestBaseWithParam<NormParams> NormFixture;
|
||||||
|
|
||||||
OCL_PERF_TEST_P(NormFixture, Norm1Arg,
|
OCL_PERF_TEST_P(NormFixture, Norm1Arg,
|
||||||
@ -1176,6 +1176,6 @@ OCL_PERF_TEST_P(ReduceAccFixture, Reduce,
|
|||||||
SANITY_CHECK(dst, eps);
|
SANITY_CHECK(dst, eps);
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
|
||||||
#endif // HAVE_OPENCL
|
#endif // HAVE_OPENCL
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
struct BufferPoolState
|
struct BufferPoolState
|
||||||
@ -127,6 +127,6 @@ OCL_PERF_TEST_P(BufferPoolFixture, BufferPool_UMatIntegral10, Bool())
|
|||||||
SANITY_CHECK_NOTHING();
|
SANITY_CHECK_NOTHING();
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
|
||||||
#endif // HAVE_OPENCL
|
#endif // HAVE_OPENCL
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
///////////// Merge////////////////////////
|
///////////// Merge////////////////////////
|
||||||
@ -156,7 +156,7 @@ OCL_PERF_TEST_P(MixChannelsFixture, MixChannels,
|
|||||||
|
|
||||||
///////////// InsertChannel ////////////////////////
|
///////////// InsertChannel ////////////////////////
|
||||||
|
|
||||||
typedef std::tr1::tuple<cv::Size, MatDepth> Size_MatDepth_t;
|
typedef tuple<cv::Size, MatDepth> Size_MatDepth_t;
|
||||||
typedef TestBaseWithParam<Size_MatDepth_t> Size_MatDepth;
|
typedef TestBaseWithParam<Size_MatDepth_t> Size_MatDepth;
|
||||||
|
|
||||||
typedef Size_MatDepth InsertChannelFixture;
|
typedef Size_MatDepth InsertChannelFixture;
|
||||||
@ -201,6 +201,6 @@ OCL_PERF_TEST_P(ExtractChannelFixture, ExtractChannel,
|
|||||||
SANITY_CHECK(dst);
|
SANITY_CHECK(dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
|
||||||
#endif // HAVE_OPENCL
|
#endif // HAVE_OPENCL
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
///////////// dft ////////////////////////
|
///////////// dft ////////////////////////
|
||||||
@ -113,6 +113,6 @@ OCL_PERF_TEST_P(MulSpectrumsFixture, MulSpectrums,
|
|||||||
SANITY_CHECK(dst, 1e-3);
|
SANITY_CHECK(dst, 1e-3);
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
|
||||||
#endif // HAVE_OPENCL
|
#endif // HAVE_OPENCL
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
///////////// gemm ////////////////////////
|
///////////// gemm ////////////////////////
|
||||||
@ -79,6 +79,6 @@ OCL_PERF_TEST_P(GemmFixture, Gemm, ::testing::Combine(
|
|||||||
SANITY_CHECK(dst, 0.01);
|
SANITY_CHECK(dst, 0.01);
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
|
||||||
#endif // HAVE_OPENCL
|
#endif // HAVE_OPENCL
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
///////////// SetTo ////////////////////////
|
///////////// SetTo ////////////////////////
|
||||||
@ -146,6 +146,6 @@ OCL_PERF_TEST_P(CopyToFixture, CopyToWithMaskUninit,
|
|||||||
SANITY_CHECK(dst);
|
SANITY_CHECK(dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
|
||||||
#endif // HAVE_OPENCL
|
#endif // HAVE_OPENCL
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
typedef TestBaseWithParam<std::tr1::tuple<cv::Size, bool> > UsageFlagsBoolFixture;
|
typedef TestBaseWithParam<tuple<cv::Size, bool> > UsageFlagsBoolFixture;
|
||||||
|
|
||||||
OCL_PERF_TEST_P(UsageFlagsBoolFixture, UsageFlags_AllocHostMem, ::testing::Combine(OCL_TEST_SIZES, Bool()))
|
OCL_PERF_TEST_P(UsageFlagsBoolFixture, UsageFlags_AllocHostMem, ::testing::Combine(OCL_TEST_SIZES, Bool()))
|
||||||
{
|
{
|
||||||
@ -37,6 +37,6 @@ OCL_PERF_TEST_P(UsageFlagsBoolFixture, UsageFlags_AllocHostMem, ::testing::Combi
|
|||||||
SANITY_CHECK_NOTHING();
|
SANITY_CHECK_NOTHING();
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
|
||||||
#endif // HAVE_OPENCL
|
#endif // HAVE_OPENCL
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
#define TYPICAL_MAT_SIZES_ABS TYPICAL_MAT_SIZES
|
#define TYPICAL_MAT_SIZES_ABS TYPICAL_MAT_SIZES
|
||||||
#define TYPICAL_MAT_TYPES_ABS CV_8SC1, CV_8SC4, CV_32SC1, CV_32FC1
|
#define TYPICAL_MAT_TYPES_ABS CV_8SC1, CV_8SC4, CV_32SC1, CV_32FC1
|
||||||
@ -24,3 +22,5 @@ PERF_TEST_P(Size_MatType, abs, TYPICAL_MATS_ABS)
|
|||||||
|
|
||||||
SANITY_CHECK(c);
|
SANITY_CHECK(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
#define TYPICAL_MAT_TYPES_ADWEIGHTED CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1
|
#define TYPICAL_MAT_TYPES_ADWEIGHTED CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1
|
||||||
#define TYPICAL_MATS_ADWEIGHTED testing::Combine(testing::Values(szVGA, sz720p, sz1080p), testing::Values(TYPICAL_MAT_TYPES_ADWEIGHTED))
|
#define TYPICAL_MATS_ADWEIGHTED testing::Combine(testing::Values(szVGA, sz720p, sz1080p), testing::Values(TYPICAL_MAT_TYPES_ADWEIGHTED))
|
||||||
@ -34,3 +32,5 @@ PERF_TEST_P(Size_MatType, addWeighted, TYPICAL_MATS_ADWEIGHTED)
|
|||||||
|
|
||||||
SANITY_CHECK(dst, 1);
|
SANITY_CHECK(dst, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
#define TYPICAL_MAT_SIZES_CORE_ARITHM ::szVGA, ::sz720p, ::sz1080p
|
#define TYPICAL_MAT_SIZES_CORE_ARITHM szVGA, sz720p, sz1080p
|
||||||
#define TYPICAL_MAT_TYPES_CORE_ARITHM CV_8UC1, CV_8SC1, CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_8UC4, CV_32SC1, CV_32FC1
|
#define TYPICAL_MAT_TYPES_CORE_ARITHM CV_8UC1, CV_8SC1, CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_8UC4, CV_32SC1, CV_32FC1
|
||||||
#define TYPICAL_MATS_CORE_ARITHM testing::Combine( testing::Values( TYPICAL_MAT_SIZES_CORE_ARITHM ), testing::Values( TYPICAL_MAT_TYPES_CORE_ARITHM ) )
|
#define TYPICAL_MATS_CORE_ARITHM testing::Combine( testing::Values( TYPICAL_MAT_SIZES_CORE_ARITHM ), testing::Values( TYPICAL_MAT_TYPES_CORE_ARITHM ) )
|
||||||
|
|
||||||
@ -20,7 +18,7 @@ PERF_TEST_P(Size_MatType, min, TYPICAL_MATS_CORE_ARITHM)
|
|||||||
|
|
||||||
declare.in(a, b, WARMUP_RNG).out(c);
|
declare.in(a, b, WARMUP_RNG).out(c);
|
||||||
|
|
||||||
TEST_CYCLE() min(a, b, c);
|
TEST_CYCLE() cv::min(a, b, c);
|
||||||
|
|
||||||
SANITY_CHECK(c);
|
SANITY_CHECK(c);
|
||||||
}
|
}
|
||||||
@ -35,7 +33,7 @@ PERF_TEST_P(Size_MatType, minScalar, TYPICAL_MATS_CORE_ARITHM)
|
|||||||
|
|
||||||
declare.in(a, b, WARMUP_RNG).out(c);
|
declare.in(a, b, WARMUP_RNG).out(c);
|
||||||
|
|
||||||
TEST_CYCLE() min(a, b, c);
|
TEST_CYCLE() cv::min(a, b, c);
|
||||||
|
|
||||||
SANITY_CHECK(c);
|
SANITY_CHECK(c);
|
||||||
}
|
}
|
||||||
@ -50,7 +48,7 @@ PERF_TEST_P(Size_MatType, max, TYPICAL_MATS_CORE_ARITHM)
|
|||||||
|
|
||||||
declare.in(a, b, WARMUP_RNG).out(c);
|
declare.in(a, b, WARMUP_RNG).out(c);
|
||||||
|
|
||||||
TEST_CYCLE() max(a, b, c);
|
TEST_CYCLE() cv::max(a, b, c);
|
||||||
|
|
||||||
SANITY_CHECK(c);
|
SANITY_CHECK(c);
|
||||||
}
|
}
|
||||||
@ -65,7 +63,7 @@ PERF_TEST_P(Size_MatType, maxScalar, TYPICAL_MATS_CORE_ARITHM)
|
|||||||
|
|
||||||
declare.in(a, b, WARMUP_RNG).out(c);
|
declare.in(a, b, WARMUP_RNG).out(c);
|
||||||
|
|
||||||
TEST_CYCLE() max(a, b, c);
|
TEST_CYCLE() cv::max(a, b, c);
|
||||||
|
|
||||||
SANITY_CHECK(c);
|
SANITY_CHECK(c);
|
||||||
}
|
}
|
||||||
@ -89,7 +87,7 @@ PERF_TEST_P(Size_MatType, absdiff, TYPICAL_MATS_CORE_ARITHM)
|
|||||||
eps = 1;
|
eps = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CYCLE() absdiff(a, b, c);
|
TEST_CYCLE() cv::absdiff(a, b, c);
|
||||||
|
|
||||||
SANITY_CHECK(c, eps);
|
SANITY_CHECK(c, eps);
|
||||||
}
|
}
|
||||||
@ -113,7 +111,7 @@ PERF_TEST_P(Size_MatType, absdiffScalar, TYPICAL_MATS_CORE_ARITHM)
|
|||||||
eps = 1;
|
eps = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CYCLE() absdiff(a, b, c);
|
TEST_CYCLE() cv::absdiff(a, b, c);
|
||||||
|
|
||||||
SANITY_CHECK(c, eps);
|
SANITY_CHECK(c, eps);
|
||||||
}
|
}
|
||||||
@ -138,7 +136,7 @@ PERF_TEST_P(Size_MatType, add, TYPICAL_MATS_CORE_ARITHM)
|
|||||||
eps = 1;
|
eps = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CYCLE() add(a, b, c);
|
TEST_CYCLE() cv::add(a, b, c);
|
||||||
|
|
||||||
SANITY_CHECK(c, eps);
|
SANITY_CHECK(c, eps);
|
||||||
}
|
}
|
||||||
@ -162,7 +160,7 @@ PERF_TEST_P(Size_MatType, addScalar, TYPICAL_MATS_CORE_ARITHM)
|
|||||||
eps = 1;
|
eps = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CYCLE() add(a, b, c);
|
TEST_CYCLE() cv::add(a, b, c);
|
||||||
|
|
||||||
SANITY_CHECK(c, eps);
|
SANITY_CHECK(c, eps);
|
||||||
}
|
}
|
||||||
@ -186,7 +184,7 @@ PERF_TEST_P(Size_MatType, subtract, TYPICAL_MATS_CORE_ARITHM)
|
|||||||
eps = 1;
|
eps = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CYCLE() subtract(a, b, c);
|
TEST_CYCLE() cv::subtract(a, b, c);
|
||||||
|
|
||||||
SANITY_CHECK(c, eps);
|
SANITY_CHECK(c, eps);
|
||||||
}
|
}
|
||||||
@ -210,7 +208,7 @@ PERF_TEST_P(Size_MatType, subtractScalar, TYPICAL_MATS_CORE_ARITHM)
|
|||||||
eps = 1;
|
eps = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CYCLE() subtract(a, b, c);
|
TEST_CYCLE() cv::subtract(a, b, c);
|
||||||
|
|
||||||
SANITY_CHECK(c, eps);
|
SANITY_CHECK(c, eps);
|
||||||
}
|
}
|
||||||
@ -229,7 +227,7 @@ PERF_TEST_P(Size_MatType, multiply, TYPICAL_MATS_CORE_ARITHM)
|
|||||||
b /= (2 << 16);
|
b /= (2 << 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CYCLE() multiply(a, b, c);
|
TEST_CYCLE() cv::multiply(a, b, c);
|
||||||
|
|
||||||
SANITY_CHECK(c, 1e-8);
|
SANITY_CHECK(c, 1e-8);
|
||||||
}
|
}
|
||||||
@ -250,7 +248,7 @@ PERF_TEST_P(Size_MatType, multiplyScale, TYPICAL_MATS_CORE_ARITHM)
|
|||||||
b /= (2 << 16);
|
b /= (2 << 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CYCLE() multiply(a, b, c, scale);
|
TEST_CYCLE() cv::multiply(a, b, c, scale);
|
||||||
|
|
||||||
SANITY_CHECK(c, 1e-8);
|
SANITY_CHECK(c, 1e-8);
|
||||||
}
|
}
|
||||||
@ -264,7 +262,7 @@ PERF_TEST_P(Size_MatType, divide, TYPICAL_MATS_CORE_ARITHM)
|
|||||||
|
|
||||||
declare.in(a, b, WARMUP_RNG).out(c);
|
declare.in(a, b, WARMUP_RNG).out(c);
|
||||||
|
|
||||||
TEST_CYCLE() divide(a, b, c, scale);
|
TEST_CYCLE() cv::divide(a, b, c, scale);
|
||||||
|
|
||||||
SANITY_CHECK_NOTHING();
|
SANITY_CHECK_NOTHING();
|
||||||
}
|
}
|
||||||
@ -278,7 +276,9 @@ PERF_TEST_P(Size_MatType, reciprocal, TYPICAL_MATS_CORE_ARITHM)
|
|||||||
|
|
||||||
declare.in(b, WARMUP_RNG).out(c);
|
declare.in(b, WARMUP_RNG).out(c);
|
||||||
|
|
||||||
TEST_CYCLE() divide(scale, b, c);
|
TEST_CYCLE() cv::divide(scale, b, c);
|
||||||
|
|
||||||
SANITY_CHECK_NOTHING();
|
SANITY_CHECK_NOTHING();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
#define TYPICAL_MAT_SIZES_BITW_ARITHM TYPICAL_MAT_SIZES
|
#define TYPICAL_MAT_SIZES_BITW_ARITHM TYPICAL_MAT_SIZES
|
||||||
#define TYPICAL_MAT_TYPES_BITW_ARITHM CV_8UC1, CV_8SC1, CV_8UC4, CV_32SC1, CV_32SC4
|
#define TYPICAL_MAT_TYPES_BITW_ARITHM CV_8UC1, CV_8SC1, CV_8UC4, CV_32SC1, CV_32SC4
|
||||||
@ -73,3 +71,5 @@ PERF_TEST_P(Size_MatType, bitwise_xor, TYPICAL_MATS_BITW_ARITHM)
|
|||||||
|
|
||||||
SANITY_CHECK(c);
|
SANITY_CHECK(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
CV_ENUM(CmpType, CMP_EQ, CMP_GT, CMP_GE, CMP_LT, CMP_LE, CMP_NE)
|
CV_ENUM(CmpType, CMP_EQ, CMP_GT, CMP_GE, CMP_LT, CMP_LE, CMP_NE)
|
||||||
|
|
||||||
typedef std::tr1::tuple<Size, MatType, CmpType> Size_MatType_CmpType_t;
|
typedef tuple<Size, MatType, CmpType> Size_MatType_CmpType_t;
|
||||||
typedef perf::TestBaseWithParam<Size_MatType_CmpType_t> Size_MatType_CmpType;
|
typedef perf::TestBaseWithParam<Size_MatType_CmpType_t> Size_MatType_CmpType;
|
||||||
|
|
||||||
PERF_TEST_P( Size_MatType_CmpType, compare,
|
PERF_TEST_P( Size_MatType_CmpType, compare,
|
||||||
@ -57,3 +55,5 @@ PERF_TEST_P( Size_MatType_CmpType, compareScalar,
|
|||||||
|
|
||||||
SANITY_CHECK(dst);
|
SANITY_CHECK(dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
@ -1,12 +1,10 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
typedef std::tr1::tuple<Size, MatType, MatType, int, double> Size_DepthSrc_DepthDst_Channels_alpha_t;
|
typedef tuple<Size, MatType, MatType, int, double> Size_DepthSrc_DepthDst_Channels_alpha_t;
|
||||||
typedef perf::TestBaseWithParam<Size_DepthSrc_DepthDst_Channels_alpha_t> Size_DepthSrc_DepthDst_Channels_alpha;
|
typedef perf::TestBaseWithParam<Size_DepthSrc_DepthDst_Channels_alpha_t> Size_DepthSrc_DepthDst_Channels_alpha;
|
||||||
|
|
||||||
PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo,
|
PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo,
|
||||||
@ -39,3 +37,5 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo,
|
|||||||
eps = eps * std::max(1.0, fabs(alpha));
|
eps = eps * std::max(1.0, fabs(alpha));
|
||||||
SANITY_CHECK(dst, eps);
|
SANITY_CHECK(dst, eps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static void CvRoundMat(const cv::Mat & src, cv::Mat & dst)
|
static void CvRoundMat(const cv::Mat & src, cv::Mat & dst)
|
||||||
@ -43,3 +41,5 @@ PERF_TEST_P(Size_MatType, CvRound_Float,
|
|||||||
|
|
||||||
SANITY_CHECK_NOTHING();
|
SANITY_CHECK_NOTHING();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////dft//////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////dft//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@ -13,7 +11,7 @@ using std::tr1::get;
|
|||||||
CV_ENUM(FlagsType, 0, DFT_INVERSE, DFT_SCALE, DFT_COMPLEX_OUTPUT, DFT_ROWS, DFT_INVERSE|DFT_COMPLEX_OUTPUT)
|
CV_ENUM(FlagsType, 0, DFT_INVERSE, DFT_SCALE, DFT_COMPLEX_OUTPUT, DFT_ROWS, DFT_INVERSE|DFT_COMPLEX_OUTPUT)
|
||||||
#define TEST_MATS_DFT testing::Combine(testing::Values(MAT_SIZES_DFT), testing::Values(MAT_TYPES_DFT), FlagsType::all(), testing::Values(true, false))
|
#define TEST_MATS_DFT testing::Combine(testing::Values(MAT_SIZES_DFT), testing::Values(MAT_TYPES_DFT), FlagsType::all(), testing::Values(true, false))
|
||||||
|
|
||||||
typedef std::tr1::tuple<Size, MatType, FlagsType, bool> Size_MatType_FlagsType_NzeroRows_t;
|
typedef tuple<Size, MatType, FlagsType, bool> Size_MatType_FlagsType_NzeroRows_t;
|
||||||
typedef perf::TestBaseWithParam<Size_MatType_FlagsType_NzeroRows_t> Size_MatType_FlagsType_NzeroRows;
|
typedef perf::TestBaseWithParam<Size_MatType_FlagsType_NzeroRows_t> Size_MatType_FlagsType_NzeroRows;
|
||||||
|
|
||||||
PERF_TEST_P(Size_MatType_FlagsType_NzeroRows, dft, TEST_MATS_DFT)
|
PERF_TEST_P(Size_MatType_FlagsType_NzeroRows, dft, TEST_MATS_DFT)
|
||||||
@ -42,7 +40,7 @@ PERF_TEST_P(Size_MatType_FlagsType_NzeroRows, dft, TEST_MATS_DFT)
|
|||||||
|
|
||||||
CV_ENUM(DCT_FlagsType, 0, DCT_INVERSE , DCT_ROWS, DCT_INVERSE|DCT_ROWS)
|
CV_ENUM(DCT_FlagsType, 0, DCT_INVERSE , DCT_ROWS, DCT_INVERSE|DCT_ROWS)
|
||||||
|
|
||||||
typedef std::tr1::tuple<Size, MatType, DCT_FlagsType> Size_MatType_Flag_t;
|
typedef tuple<Size, MatType, DCT_FlagsType> Size_MatType_Flag_t;
|
||||||
typedef perf::TestBaseWithParam<Size_MatType_Flag_t> Size_MatType_Flag;
|
typedef perf::TestBaseWithParam<Size_MatType_Flag_t> Size_MatType_Flag;
|
||||||
|
|
||||||
PERF_TEST_P(Size_MatType_Flag, dct, testing::Combine(
|
PERF_TEST_P(Size_MatType_Flag, dct, testing::Combine(
|
||||||
@ -66,4 +64,6 @@ PERF_TEST_P(Size_MatType_Flag, dct, testing::Combine(
|
|||||||
TEST_CYCLE() dct(src, dst, flags);
|
TEST_CYCLE() dct(src, dst, flags);
|
||||||
|
|
||||||
SANITY_CHECK(dst, 1e-5, ERROR_RELATIVE);
|
SANITY_CHECK(dst, 1e-5, ERROR_RELATIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
typedef tr1::tuple<MatType, int> MatType_Length_t;
|
typedef tuple<MatType, int> MatType_Length_t;
|
||||||
typedef TestBaseWithParam<MatType_Length_t> MatType_Length;
|
typedef TestBaseWithParam<MatType_Length_t> MatType_Length;
|
||||||
|
|
||||||
PERF_TEST_P( MatType_Length, dot,
|
PERF_TEST_P( MatType_Length, dot,
|
||||||
@ -29,3 +27,5 @@ PERF_TEST_P( MatType_Length, dot,
|
|||||||
|
|
||||||
SANITY_CHECK(product, 1e-6, ERROR_RELATIVE);
|
SANITY_CHECK(product, 1e-6, ERROR_RELATIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
#define TYPICAL_MAT_TYPES_INRANGE CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_32FC4
|
#define TYPICAL_MAT_TYPES_INRANGE CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_32FC4
|
||||||
#define TYPICAL_MATS_INRANGE testing::Combine(testing::Values(szVGA, sz720p, sz1080p), testing::Values(TYPICAL_MAT_TYPES_INRANGE))
|
#define TYPICAL_MATS_INRANGE testing::Combine(testing::Values(szVGA, sz720p, sz1080p), testing::Values(TYPICAL_MAT_TYPES_INRANGE))
|
||||||
@ -24,3 +22,5 @@ PERF_TEST_P(Size_MatType, inRange, TYPICAL_MATS_INRANGE)
|
|||||||
|
|
||||||
SANITY_CHECK(dst);
|
SANITY_CHECK(dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
typedef std::tr1::tuple<cv::Size, MatType, String> Size_MatType_Str_t;
|
typedef tuple<cv::Size, MatType, String> Size_MatType_Str_t;
|
||||||
typedef TestBaseWithParam<Size_MatType_Str_t> Size_Mat_StrType;
|
typedef TestBaseWithParam<Size_MatType_Str_t> Size_Mat_StrType;
|
||||||
|
|
||||||
#define MAT_SIZES ::perf::sz1080p/*, ::perf::sz4320p*/
|
#define MAT_SIZES ::perf::sz1080p/*, ::perf::sz4320p*/
|
||||||
@ -84,3 +82,5 @@ PERF_TEST_P(Size_Mat_StrType, fs_base64,
|
|||||||
remove(file_name.c_str());
|
remove(file_name.c_str());
|
||||||
SANITY_CHECK_NOTHING();
|
SANITY_CHECK_NOTHING();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test { namespace {
|
||||||
using namespace cv;
|
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
|
|
||||||
typedef perf::TestBaseWithParam<Size> SizePrm;
|
typedef perf::TestBaseWithParam<Size> SizePrm;
|
||||||
@ -24,3 +23,5 @@ PERF_TEST_P( SizePrm, LUT,
|
|||||||
|
|
||||||
SANITY_CHECK(dst, 0.1);
|
SANITY_CHECK(dst, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
PERF_TEST_P(Size_MatType, Mat_Eye,
|
PERF_TEST_P(Size_MatType, Mat_Eye,
|
||||||
testing::Combine(testing::Values(TYPICAL_MAT_SIZES),
|
testing::Combine(testing::Values(TYPICAL_MAT_SIZES),
|
||||||
@ -124,3 +122,5 @@ PERF_TEST_P(Size_MatType, Mat_Transform,
|
|||||||
|
|
||||||
SANITY_CHECK(dst, 1e-6, ERROR_RELATIVE);
|
SANITY_CHECK(dst, 1e-6, ERROR_RELATIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -158,3 +158,5 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/ , KMeans,
|
|||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
typedef std::tr1::tuple<Size, MatType, int> Size_SrcDepth_DstChannels_t;
|
typedef tuple<Size, MatType, int> Size_SrcDepth_DstChannels_t;
|
||||||
typedef perf::TestBaseWithParam<Size_SrcDepth_DstChannels_t> Size_SrcDepth_DstChannels;
|
typedef perf::TestBaseWithParam<Size_SrcDepth_DstChannels_t> Size_SrcDepth_DstChannels;
|
||||||
|
|
||||||
PERF_TEST_P( Size_SrcDepth_DstChannels, merge,
|
PERF_TEST_P( Size_SrcDepth_DstChannels, merge,
|
||||||
@ -38,3 +36,5 @@ PERF_TEST_P( Size_SrcDepth_DstChannels, merge,
|
|||||||
double eps = srcDepth <= CV_32S ? 1e-12 : (FLT_EPSILON * maxValue);
|
double eps = srcDepth <= CV_32S ? 1e-12 : (FLT_EPSILON * maxValue);
|
||||||
SANITY_CHECK(dst, eps);
|
SANITY_CHECK(dst, eps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
PERF_TEST_P(Size_MatType, minMaxLoc, testing::Combine(
|
PERF_TEST_P(Size_MatType, minMaxLoc, testing::Combine(
|
||||||
testing::Values(TYPICAL_MAT_SIZES),
|
testing::Values(TYPICAL_MAT_SIZES),
|
||||||
@ -33,3 +31,5 @@ PERF_TEST_P(Size_MatType, minMaxLoc, testing::Combine(
|
|||||||
SANITY_CHECK(minVal, 1e-12);
|
SANITY_CHECK(minVal, 1e-12);
|
||||||
SANITY_CHECK(maxVal, 1e-12);
|
SANITY_CHECK(maxVal, 1e-12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,16 +1,14 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
#define HAMMING_NORM_SIZES cv::Size(640, 480), cv::Size(1920, 1080)
|
#define HAMMING_NORM_SIZES cv::Size(640, 480), cv::Size(1920, 1080)
|
||||||
#define HAMMING_NORM_TYPES CV_8UC1
|
#define HAMMING_NORM_TYPES CV_8UC1
|
||||||
|
|
||||||
CV_FLAGS(NormType, NORM_HAMMING2, NORM_HAMMING, NORM_INF, NORM_L1, NORM_L2, NORM_TYPE_MASK, NORM_RELATIVE, NORM_MINMAX)
|
CV_FLAGS(NormType, NORM_HAMMING2, NORM_HAMMING, NORM_INF, NORM_L1, NORM_L2, NORM_TYPE_MASK, NORM_RELATIVE, NORM_MINMAX)
|
||||||
typedef std::tr1::tuple<Size, MatType, NormType> Size_MatType_NormType_t;
|
typedef tuple<Size, MatType, NormType> Size_MatType_NormType_t;
|
||||||
typedef perf::TestBaseWithParam<Size_MatType_NormType_t> Size_MatType_NormType;
|
typedef perf::TestBaseWithParam<Size_MatType_NormType_t> Size_MatType_NormType;
|
||||||
|
|
||||||
PERF_TEST_P(Size_MatType_NormType, norm,
|
PERF_TEST_P(Size_MatType_NormType, norm,
|
||||||
@ -30,7 +28,7 @@ PERF_TEST_P(Size_MatType_NormType, norm,
|
|||||||
|
|
||||||
declare.in(src, WARMUP_RNG);
|
declare.in(src, WARMUP_RNG);
|
||||||
|
|
||||||
TEST_CYCLE() n = norm(src, normType);
|
TEST_CYCLE() n = cv::norm(src, normType);
|
||||||
|
|
||||||
SANITY_CHECK(n, 1e-6, ERROR_RELATIVE);
|
SANITY_CHECK(n, 1e-6, ERROR_RELATIVE);
|
||||||
}
|
}
|
||||||
@ -53,7 +51,7 @@ PERF_TEST_P(Size_MatType_NormType, norm_mask,
|
|||||||
|
|
||||||
declare.in(src, WARMUP_RNG).in(mask);
|
declare.in(src, WARMUP_RNG).in(mask);
|
||||||
|
|
||||||
TEST_CYCLE() n = norm(src, normType, mask);
|
TEST_CYCLE() n = cv::norm(src, normType, mask);
|
||||||
|
|
||||||
SANITY_CHECK(n, 1e-6, ERROR_RELATIVE);
|
SANITY_CHECK(n, 1e-6, ERROR_RELATIVE);
|
||||||
}
|
}
|
||||||
@ -76,7 +74,7 @@ PERF_TEST_P(Size_MatType_NormType, norm2,
|
|||||||
|
|
||||||
declare.in(src1, src2, WARMUP_RNG);
|
declare.in(src1, src2, WARMUP_RNG);
|
||||||
|
|
||||||
TEST_CYCLE() n = norm(src1, src2, normType);
|
TEST_CYCLE() n = cv::norm(src1, src2, normType);
|
||||||
|
|
||||||
SANITY_CHECK(n, 1e-5, ERROR_RELATIVE);
|
SANITY_CHECK(n, 1e-5, ERROR_RELATIVE);
|
||||||
}
|
}
|
||||||
@ -100,13 +98,13 @@ PERF_TEST_P(Size_MatType_NormType, norm2_mask,
|
|||||||
|
|
||||||
declare.in(src1, src2, WARMUP_RNG).in(mask);
|
declare.in(src1, src2, WARMUP_RNG).in(mask);
|
||||||
|
|
||||||
TEST_CYCLE() n = norm(src1, src2, normType, mask);
|
TEST_CYCLE() n = cv::norm(src1, src2, normType, mask);
|
||||||
|
|
||||||
SANITY_CHECK(n, 1e-5, ERROR_RELATIVE);
|
SANITY_CHECK(n, 1e-5, ERROR_RELATIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
typedef std::tr1::tuple<NormType, MatType, Size> PerfHamming_t;
|
typedef tuple<NormType, MatType, Size> PerfHamming_t;
|
||||||
typedef perf::TestBaseWithParam<PerfHamming_t> PerfHamming;
|
typedef perf::TestBaseWithParam<PerfHamming_t> PerfHamming;
|
||||||
|
|
||||||
PERF_TEST_P(PerfHamming, norm,
|
PERF_TEST_P(PerfHamming, norm,
|
||||||
@ -126,7 +124,7 @@ PERF_TEST_P(PerfHamming, norm,
|
|||||||
|
|
||||||
declare.in(src, WARMUP_RNG);
|
declare.in(src, WARMUP_RNG);
|
||||||
|
|
||||||
TEST_CYCLE() n = norm(src, normType);
|
TEST_CYCLE() n = cv::norm(src, normType);
|
||||||
|
|
||||||
(void)n;
|
(void)n;
|
||||||
SANITY_CHECK_NOTHING();
|
SANITY_CHECK_NOTHING();
|
||||||
@ -150,7 +148,7 @@ PERF_TEST_P(PerfHamming, norm2,
|
|||||||
|
|
||||||
declare.in(src1, src2, WARMUP_RNG);
|
declare.in(src1, src2, WARMUP_RNG);
|
||||||
|
|
||||||
TEST_CYCLE() n = norm(src1, src2, normType);
|
TEST_CYCLE() n = cv::norm(src1, src2, normType);
|
||||||
|
|
||||||
(void)n;
|
(void)n;
|
||||||
SANITY_CHECK_NOTHING();
|
SANITY_CHECK_NOTHING();
|
||||||
@ -180,7 +178,7 @@ PERF_TEST_P(Size_MatType_NormType, normalize,
|
|||||||
|
|
||||||
declare.in(src, WARMUP_RNG).out(dst);
|
declare.in(src, WARMUP_RNG).out(dst);
|
||||||
|
|
||||||
TEST_CYCLE() normalize(src, dst, alpha, 0., normType);
|
TEST_CYCLE() cv::normalize(src, dst, alpha, 0., normType);
|
||||||
|
|
||||||
SANITY_CHECK(dst, 1e-6);
|
SANITY_CHECK(dst, 1e-6);
|
||||||
}
|
}
|
||||||
@ -208,7 +206,7 @@ PERF_TEST_P(Size_MatType_NormType, normalize_mask,
|
|||||||
declare.in(src, WARMUP_RNG).in(mask).out(dst);
|
declare.in(src, WARMUP_RNG).in(mask).out(dst);
|
||||||
declare.time(100);
|
declare.time(100);
|
||||||
|
|
||||||
TEST_CYCLE() normalize(src, dst, alpha, 0., normType, -1, mask);
|
TEST_CYCLE() cv::normalize(src, dst, alpha, 0., normType, -1, mask);
|
||||||
|
|
||||||
SANITY_CHECK(dst, 1e-6);
|
SANITY_CHECK(dst, 1e-6);
|
||||||
}
|
}
|
||||||
@ -234,7 +232,7 @@ PERF_TEST_P(Size_MatType_NormType, normalize_32f,
|
|||||||
|
|
||||||
declare.in(src, WARMUP_RNG).out(dst);
|
declare.in(src, WARMUP_RNG).out(dst);
|
||||||
|
|
||||||
TEST_CYCLE() normalize(src, dst, alpha, 0., normType, CV_32F);
|
TEST_CYCLE() cv::normalize(src, dst, alpha, 0., normType, CV_32F);
|
||||||
|
|
||||||
SANITY_CHECK(dst, 1e-6, ERROR_RELATIVE);
|
SANITY_CHECK(dst, 1e-6, ERROR_RELATIVE);
|
||||||
}
|
}
|
||||||
@ -250,7 +248,9 @@ PERF_TEST_P( Size_MatType, normalize_minmax, TYPICAL_MATS )
|
|||||||
declare.in(src, WARMUP_RNG).out(dst);
|
declare.in(src, WARMUP_RNG).out(dst);
|
||||||
declare.time(30);
|
declare.time(30);
|
||||||
|
|
||||||
TEST_CYCLE() normalize(src, dst, 20., 100., NORM_MINMAX);
|
TEST_CYCLE() cv::normalize(src, dst, 20., 100., NORM_MINMAX);
|
||||||
|
|
||||||
SANITY_CHECK(dst, 1e-6, ERROR_RELATIVE);
|
SANITY_CHECK(dst, 1e-6, ERROR_RELATIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,18 +1,9 @@
|
|||||||
#ifdef __GNUC__
|
// This file is part of OpenCV project.
|
||||||
# pragma GCC diagnostic ignored "-Wmissing-declarations"
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
# if defined __clang__ || defined __APPLE__
|
// of this distribution and at http://opencv.org/license.html
|
||||||
# pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
|
||||||
# pragma GCC diagnostic ignored "-Wextra"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __OPENCV_PERF_PRECOMP_HPP__
|
#ifndef __OPENCV_PERF_PRECOMP_HPP__
|
||||||
#define __OPENCV_PERF_PRECOMP_HPP__
|
#define __OPENCV_PERF_PRECOMP_HPP__
|
||||||
|
|
||||||
#include "opencv2/ts.hpp"
|
#include "opencv2/ts.hpp"
|
||||||
|
|
||||||
#ifdef GTEST_CREATE_SHARED_LIBRARY
|
|
||||||
#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
#include "opencv2/core/core_c.h"
|
#include "opencv2/core/core_c.h"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
CV_ENUM(ROp, CV_REDUCE_SUM, CV_REDUCE_AVG, CV_REDUCE_MAX, CV_REDUCE_MIN)
|
CV_ENUM(ROp, CV_REDUCE_SUM, CV_REDUCE_AVG, CV_REDUCE_MAX, CV_REDUCE_MIN)
|
||||||
typedef std::tr1::tuple<Size, MatType, ROp> Size_MatType_ROp_t;
|
typedef tuple<Size, MatType, ROp> Size_MatType_ROp_t;
|
||||||
typedef perf::TestBaseWithParam<Size_MatType_ROp_t> Size_MatType_ROp;
|
typedef perf::TestBaseWithParam<Size_MatType_ROp_t> Size_MatType_ROp;
|
||||||
|
|
||||||
|
|
||||||
@ -66,3 +64,5 @@ PERF_TEST_P(Size_MatType_ROp, reduceC,
|
|||||||
|
|
||||||
SANITY_CHECK(vec, 1);
|
SANITY_CHECK(vec, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
|
|
||||||
using std::tr1::tuple;
|
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
#define TYPICAL_MAT_SIZES_SORT TYPICAL_MAT_SIZES
|
#define TYPICAL_MAT_SIZES_SORT TYPICAL_MAT_SIZES
|
||||||
#define TYPICAL_MAT_TYPES_SORT CV_8UC1, CV_16UC1, CV_32FC1
|
#define TYPICAL_MAT_TYPES_SORT CV_8UC1, CV_16UC1, CV_32FC1
|
||||||
#define SORT_TYPES SORT_EVERY_ROW | SORT_ASCENDING, SORT_EVERY_ROW | SORT_DESCENDING
|
#define SORT_TYPES SORT_EVERY_ROW | SORT_ASCENDING, SORT_EVERY_ROW | SORT_DESCENDING
|
||||||
@ -50,3 +46,5 @@ PERF_TEST_P(sortIdxFixture, sorIdx, TYPICAL_MATS_SORT)
|
|||||||
|
|
||||||
SANITY_CHECK_NOTHING();
|
SANITY_CHECK_NOTHING();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
typedef std::tr1::tuple<Size, MatType, int> Size_Depth_Channels_t;
|
typedef tuple<Size, MatType, int> Size_Depth_Channels_t;
|
||||||
typedef perf::TestBaseWithParam<Size_Depth_Channels_t> Size_Depth_Channels;
|
typedef perf::TestBaseWithParam<Size_Depth_Channels_t> Size_Depth_Channels;
|
||||||
|
|
||||||
PERF_TEST_P( Size_Depth_Channels, split,
|
PERF_TEST_P( Size_Depth_Channels, split,
|
||||||
@ -35,3 +33,5 @@ PERF_TEST_P( Size_Depth_Channels, split,
|
|||||||
SANITY_CHECK(mv, 1e-12);
|
SANITY_CHECK(mv, 1e-12);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace perf;
|
using namespace perf;
|
||||||
using std::tr1::make_tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
PERF_TEST_P(Size_MatType, sum, TYPICAL_MATS)
|
PERF_TEST_P(Size_MatType, sum, TYPICAL_MATS)
|
||||||
{
|
{
|
||||||
@ -102,3 +100,5 @@ PERF_TEST_P(Size_MatType, countNonZero, testing::Combine( testing::Values( TYPIC
|
|||||||
|
|
||||||
SANITY_CHECK(cnt);
|
SANITY_CHECK(cnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -5,13 +5,10 @@
|
|||||||
#include "perf_precomp.hpp"
|
#include "perf_precomp.hpp"
|
||||||
#include "opencv2/ts/ocl_perf.hpp"
|
#include "opencv2/ts/ocl_perf.hpp"
|
||||||
|
|
||||||
using namespace std;
|
namespace opencv_test
|
||||||
using namespace cv;
|
{
|
||||||
using namespace ::perf;
|
using namespace perf;
|
||||||
using namespace ::cvtest::ocl;
|
using namespace ::cvtest::ocl;
|
||||||
using namespace ::testing;
|
|
||||||
using std::tr1::tuple;
|
|
||||||
using std::tr1::get;
|
|
||||||
|
|
||||||
|
|
||||||
struct OpenCLState
|
struct OpenCLState
|
||||||
@ -63,3 +60,5 @@ OCL_PERF_TEST_P(UMatTest, CustomPtr, Combine(Values(sz1080p, sz2160p), Bool(), :
|
|||||||
|
|
||||||
SANITY_CHECK_NOTHING();
|
SANITY_CHECK_NOTHING();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
@ -42,11 +42,9 @@
|
|||||||
#include "../test_precomp.hpp"
|
#include "../test_precomp.hpp"
|
||||||
#include "opencv2/ts/ocl_test.hpp"
|
#include "opencv2/ts/ocl_test.hpp"
|
||||||
|
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
//////////////////////////////// LUT /////////////////////////////////////////////////
|
//////////////////////////////// LUT /////////////////////////////////////////////////
|
||||||
@ -138,8 +136,8 @@ PARAM_TEST_CASE(ArithmTestBase, MatDepth, Channels, bool)
|
|||||||
{
|
{
|
||||||
const int type = CV_MAKE_TYPE(depth, cn);
|
const int type = CV_MAKE_TYPE(depth, cn);
|
||||||
|
|
||||||
double minV = getMinVal(type);
|
double minV = cvtest::getMinVal(type);
|
||||||
double maxV = getMaxVal(type);
|
double maxV = cvtest::getMaxVal(type);
|
||||||
|
|
||||||
Size roiSize = randomSize(1, MAX_VALUE);
|
Size roiSize = randomSize(1, MAX_VALUE);
|
||||||
Border src1Border = randomBorder(0, use_roi ? MAX_VALUE : 0);
|
Border src1Border = randomBorder(0, use_roi ? MAX_VALUE : 0);
|
||||||
@ -1964,6 +1962,6 @@ OCL_TEST(Normalize, DISABLED_regression_5876_inplace_change_type)
|
|||||||
EXPECT_EQ(0, cvtest::norm(um, uresult, NORM_INF));
|
EXPECT_EQ(0, cvtest::norm(um, uresult, NORM_INF));
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
|
||||||
#endif // HAVE_OPENCL
|
#endif // HAVE_OPENCL
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
//////////////////////////////////////// Merge ///////////////////////////////////////////////
|
//////////////////////////////////////// Merge ///////////////////////////////////////////////
|
||||||
@ -464,6 +464,6 @@ OCL_INSTANTIATE_TEST_CASE_P(Channels, MixChannels, Combine(OCL_ALL_DEPTHS, Bool(
|
|||||||
OCL_INSTANTIATE_TEST_CASE_P(Channels, InsertChannel, Combine(OCL_ALL_DEPTHS, OCL_ALL_CHANNELS, Bool()));
|
OCL_INSTANTIATE_TEST_CASE_P(Channels, InsertChannel, Combine(OCL_ALL_DEPTHS, OCL_ALL_CHANNELS, Bool()));
|
||||||
OCL_INSTANTIATE_TEST_CASE_P(Channels, ExtractChannel, Combine(OCL_ALL_DEPTHS, OCL_ALL_CHANNELS, Bool()));
|
OCL_INSTANTIATE_TEST_CASE_P(Channels, ExtractChannel, Combine(OCL_ALL_DEPTHS, OCL_ALL_CHANNELS, Bool()));
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
|
||||||
#endif // HAVE_OPENCL
|
#endif // HAVE_OPENCL
|
||||||
|
@ -56,7 +56,7 @@ enum OCL_FFT_TYPE
|
|||||||
C2C = 3
|
C2C = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
@ -185,6 +185,6 @@ OCL_INSTANTIATE_TEST_CASE_P(Core, Dft, Combine(Values(cv::Size(45, 72), cv::Size
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
|
||||||
#endif // HAVE_OPENCL
|
#endif // HAVE_OPENCL
|
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
@ -145,6 +145,6 @@ OCL_INSTANTIATE_TEST_CASE_P(Core, Gemm, ::testing::Combine(
|
|||||||
testing::Values(CV_32FC1, CV_32FC2, CV_64FC1, CV_64FC2),
|
testing::Values(CV_32FC1, CV_32FC2, CV_64FC1, CV_64FC2),
|
||||||
Bool(), Bool(), Bool(), Bool()));
|
Bool(), Bool(), Bool(), Bool()));
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
|
||||||
#endif // HAVE_OPENCL
|
#endif // HAVE_OPENCL
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
TEST(Image2D, createAliasEmptyUMat)
|
TEST(Image2D, createAliasEmptyUMat)
|
||||||
@ -91,6 +91,6 @@ TEST(Image2D, turnOffOpenCL)
|
|||||||
std::cout << "OpenCL runtime not found. Test skipped." << std::endl;
|
std::cout << "OpenCL runtime not found. Test skipped." << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
|
||||||
#endif // HAVE_OPENCL
|
#endif // HAVE_OPENCL
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
//////////////////////////////// UMat Expressions /////////////////////////////////////////////////
|
//////////////////////////////// UMat Expressions /////////////////////////////////////////////////
|
||||||
@ -80,6 +80,6 @@ OCL_TEST_P(UMatExpr, Ones)
|
|||||||
|
|
||||||
OCL_INSTANTIATE_TEST_CASE_P(MatrixOperation, UMatExpr, Combine(OCL_ALL_DEPTHS, OCL_ALL_CHANNELS));
|
OCL_INSTANTIATE_TEST_CASE_P(MatrixOperation, UMatExpr, Combine(OCL_ALL_DEPTHS, OCL_ALL_CHANNELS));
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
////////////////////////////////converto/////////////////////////////////////////////////
|
////////////////////////////////converto/////////////////////////////////////////////////
|
||||||
@ -219,6 +219,6 @@ OCL_INSTANTIATE_TEST_CASE_P(MatrixOperation, CopyTo, Combine(
|
|||||||
OCL_INSTANTIATE_TEST_CASE_P(MatrixOperation, SetTo, Combine(
|
OCL_INSTANTIATE_TEST_CASE_P(MatrixOperation, SetTo, Combine(
|
||||||
OCL_ALL_DEPTHS, OCL_ALL_CHANNELS, Bool(), Bool()));
|
OCL_ALL_DEPTHS, OCL_ALL_CHANNELS, Bool(), Bool()));
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include "../test_precomp.hpp"
|
#include "../test_precomp.hpp"
|
||||||
|
|
||||||
#include <opencv2/core/ocl.hpp>
|
#include <opencv2/core/ocl.hpp>
|
||||||
#include <fstream>
|
|
||||||
|
|
||||||
namespace opencv_test { namespace {
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
#include "test_precomp.hpp"
|
// This file is part of OpenCV project.
|
||||||
#include <cmath>
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace cvtest
|
|
||||||
{
|
|
||||||
|
|
||||||
const int ARITHM_NTESTS = 1000;
|
const int ARITHM_NTESTS = 1000;
|
||||||
const int ARITHM_RNG_SEED = -1;
|
const int ARITHM_RNG_SEED = -1;
|
||||||
@ -31,7 +29,7 @@ struct BaseElemWiseOp
|
|||||||
|
|
||||||
virtual void getRandomSize(RNG& rng, vector<int>& size)
|
virtual void getRandomSize(RNG& rng, vector<int>& size)
|
||||||
{
|
{
|
||||||
cvtest::randomSize(rng, 2, ARITHM_MAX_NDIMS, cvtest::ARITHM_MAX_SIZE_LOG, size);
|
cvtest::randomSize(rng, 2, ARITHM_MAX_NDIMS, ARITHM_MAX_SIZE_LOG, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getRandomType(RNG& rng)
|
virtual int getRandomType(RNG& rng)
|
||||||
@ -119,9 +117,9 @@ struct AddOp : public BaseAddOp
|
|||||||
void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
||||||
{
|
{
|
||||||
if( mask.empty() )
|
if( mask.empty() )
|
||||||
add(src[0], src[1], dst);
|
cv::add(src[0], src[1], dst);
|
||||||
else
|
else
|
||||||
add(src[0], src[1], dst, mask);
|
cv::add(src[0], src[1], dst, mask);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -132,9 +130,9 @@ struct SubOp : public BaseAddOp
|
|||||||
void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
||||||
{
|
{
|
||||||
if( mask.empty() )
|
if( mask.empty() )
|
||||||
subtract(src[0], src[1], dst);
|
cv::subtract(src[0], src[1], dst);
|
||||||
else
|
else
|
||||||
subtract(src[0], src[1], dst, mask);
|
cv::subtract(src[0], src[1], dst, mask);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -145,9 +143,9 @@ struct AddSOp : public BaseAddOp
|
|||||||
void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
||||||
{
|
{
|
||||||
if( mask.empty() )
|
if( mask.empty() )
|
||||||
add(src[0], gamma, dst);
|
cv::add(src[0], gamma, dst);
|
||||||
else
|
else
|
||||||
add(src[0], gamma, dst, mask);
|
cv::add(src[0], gamma, dst, mask);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -158,9 +156,9 @@ struct SubRSOp : public BaseAddOp
|
|||||||
void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
||||||
{
|
{
|
||||||
if( mask.empty() )
|
if( mask.empty() )
|
||||||
subtract(gamma, src[0], dst);
|
cv::subtract(gamma, src[0], dst);
|
||||||
else
|
else
|
||||||
subtract(gamma, src[0], dst, mask);
|
cv::subtract(gamma, src[0], dst, mask);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -170,7 +168,7 @@ struct ScaleAddOp : public BaseAddOp
|
|||||||
ScaleAddOp() : BaseAddOp(2, FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
|
ScaleAddOp() : BaseAddOp(2, FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
|
||||||
void op(const vector<Mat>& src, Mat& dst, const Mat&)
|
void op(const vector<Mat>& src, Mat& dst, const Mat&)
|
||||||
{
|
{
|
||||||
scaleAdd(src[0], alpha, src[1], dst);
|
cv::scaleAdd(src[0], alpha, src[1], dst);
|
||||||
}
|
}
|
||||||
double getMaxErr(int depth)
|
double getMaxErr(int depth)
|
||||||
{
|
{
|
||||||
@ -184,7 +182,7 @@ struct AddWeightedOp : public BaseAddOp
|
|||||||
AddWeightedOp() : BaseAddOp(2, REAL_GAMMA, 1, 1, Scalar::all(0)) {}
|
AddWeightedOp() : BaseAddOp(2, REAL_GAMMA, 1, 1, Scalar::all(0)) {}
|
||||||
void op(const vector<Mat>& src, Mat& dst, const Mat&)
|
void op(const vector<Mat>& src, Mat& dst, const Mat&)
|
||||||
{
|
{
|
||||||
addWeighted(src[0], alpha, src[1], beta, gamma[0], dst);
|
cv::addWeighted(src[0], alpha, src[1], beta, gamma[0], dst);
|
||||||
}
|
}
|
||||||
double getMaxErr(int depth)
|
double getMaxErr(int depth)
|
||||||
{
|
{
|
||||||
@ -282,11 +280,11 @@ struct LogicOp : public BaseElemWiseOp
|
|||||||
void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
||||||
{
|
{
|
||||||
if( opcode == '&' )
|
if( opcode == '&' )
|
||||||
bitwise_and(src[0], src[1], dst, mask);
|
cv::bitwise_and(src[0], src[1], dst, mask);
|
||||||
else if( opcode == '|' )
|
else if( opcode == '|' )
|
||||||
bitwise_or(src[0], src[1], dst, mask);
|
cv::bitwise_or(src[0], src[1], dst, mask);
|
||||||
else
|
else
|
||||||
bitwise_xor(src[0], src[1], dst, mask);
|
cv::bitwise_xor(src[0], src[1], dst, mask);
|
||||||
}
|
}
|
||||||
void refop(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
void refop(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
||||||
{
|
{
|
||||||
@ -313,13 +311,13 @@ struct LogicSOp : public BaseElemWiseOp
|
|||||||
void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
||||||
{
|
{
|
||||||
if( opcode == '&' )
|
if( opcode == '&' )
|
||||||
bitwise_and(src[0], gamma, dst, mask);
|
cv::bitwise_and(src[0], gamma, dst, mask);
|
||||||
else if( opcode == '|' )
|
else if( opcode == '|' )
|
||||||
bitwise_or(src[0], gamma, dst, mask);
|
cv::bitwise_or(src[0], gamma, dst, mask);
|
||||||
else if( opcode == '^' )
|
else if( opcode == '^' )
|
||||||
bitwise_xor(src[0], gamma, dst, mask);
|
cv::bitwise_xor(src[0], gamma, dst, mask);
|
||||||
else
|
else
|
||||||
bitwise_not(src[0], dst);
|
cv::bitwise_not(src[0], dst);
|
||||||
}
|
}
|
||||||
void refop(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
void refop(const vector<Mat>& src, Mat& dst, const Mat& mask)
|
||||||
{
|
{
|
||||||
@ -547,6 +545,7 @@ template<typename _Tp> static void inRange_(const _Tp* src, const _Tp* a, const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace reference {
|
||||||
|
|
||||||
static void inRange(const Mat& src, const Mat& lb, const Mat& rb, Mat& dst)
|
static void inRange(const Mat& src, const Mat& lb, const Mat& rb, Mat& dst)
|
||||||
{
|
{
|
||||||
@ -597,7 +596,6 @@ static void inRange(const Mat& src, const Mat& lb, const Mat& rb, Mat& dst)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void inRangeS(const Mat& src, const Scalar& lb, const Scalar& rb, Mat& dst)
|
static void inRangeS(const Mat& src, const Scalar& lb, const Scalar& rb, Mat& dst)
|
||||||
{
|
{
|
||||||
dst.create( src.dims, &src.size[0], CV_8U );
|
dst.create( src.dims, &src.size[0], CV_8U );
|
||||||
@ -647,6 +645,8 @@ static void inRangeS(const Mat& src, const Scalar& lb, const Scalar& rb, Mat& ds
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
CVTEST_GUARD_SYMBOL(inRange);
|
||||||
|
|
||||||
struct InRangeSOp : public BaseElemWiseOp
|
struct InRangeSOp : public BaseElemWiseOp
|
||||||
{
|
{
|
||||||
@ -657,7 +657,7 @@ struct InRangeSOp : public BaseElemWiseOp
|
|||||||
}
|
}
|
||||||
void refop(const vector<Mat>& src, Mat& dst, const Mat&)
|
void refop(const vector<Mat>& src, Mat& dst, const Mat&)
|
||||||
{
|
{
|
||||||
cvtest::inRangeS(src[0], gamma, gamma1, dst);
|
reference::inRangeS(src[0], gamma, gamma1, dst);
|
||||||
}
|
}
|
||||||
double getMaxErr(int)
|
double getMaxErr(int)
|
||||||
{
|
{
|
||||||
@ -695,7 +695,7 @@ struct InRangeOp : public BaseElemWiseOp
|
|||||||
cvtest::min(src[1], src[2], lb);
|
cvtest::min(src[1], src[2], lb);
|
||||||
cvtest::max(src[1], src[2], rb);
|
cvtest::max(src[1], src[2], rb);
|
||||||
|
|
||||||
cvtest::inRange(src[0], lb, rb, dst);
|
reference::inRange(src[0], lb, rb, dst);
|
||||||
}
|
}
|
||||||
double getMaxErr(int)
|
double getMaxErr(int)
|
||||||
{
|
{
|
||||||
@ -827,6 +827,7 @@ struct ConvertScaleAbsOp : public BaseElemWiseOp
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace reference {
|
||||||
|
|
||||||
static void flip(const Mat& src, Mat& dst, int flipcode)
|
static void flip(const Mat& src, Mat& dst, int flipcode)
|
||||||
{
|
{
|
||||||
@ -867,13 +868,14 @@ static void setIdentity(Mat& dst, const Scalar& s)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
struct FlipOp : public BaseElemWiseOp
|
struct FlipOp : public BaseElemWiseOp
|
||||||
{
|
{
|
||||||
FlipOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) { flipcode = 0; }
|
FlipOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) { flipcode = 0; }
|
||||||
void getRandomSize(RNG& rng, vector<int>& size)
|
void getRandomSize(RNG& rng, vector<int>& size)
|
||||||
{
|
{
|
||||||
cvtest::randomSize(rng, 2, 2, cvtest::ARITHM_MAX_SIZE_LOG, size);
|
cvtest::randomSize(rng, 2, 2, ARITHM_MAX_SIZE_LOG, size);
|
||||||
}
|
}
|
||||||
void op(const vector<Mat>& src, Mat& dst, const Mat&)
|
void op(const vector<Mat>& src, Mat& dst, const Mat&)
|
||||||
{
|
{
|
||||||
@ -881,7 +883,7 @@ struct FlipOp : public BaseElemWiseOp
|
|||||||
}
|
}
|
||||||
void refop(const vector<Mat>& src, Mat& dst, const Mat&)
|
void refop(const vector<Mat>& src, Mat& dst, const Mat&)
|
||||||
{
|
{
|
||||||
cvtest::flip(src[0], dst, flipcode);
|
reference::flip(src[0], dst, flipcode);
|
||||||
}
|
}
|
||||||
void generateScalars(int, RNG& rng)
|
void generateScalars(int, RNG& rng)
|
||||||
{
|
{
|
||||||
@ -899,7 +901,7 @@ struct TransposeOp : public BaseElemWiseOp
|
|||||||
TransposeOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
|
TransposeOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
|
||||||
void getRandomSize(RNG& rng, vector<int>& size)
|
void getRandomSize(RNG& rng, vector<int>& size)
|
||||||
{
|
{
|
||||||
cvtest::randomSize(rng, 2, 2, cvtest::ARITHM_MAX_SIZE_LOG, size);
|
cvtest::randomSize(rng, 2, 2, ARITHM_MAX_SIZE_LOG, size);
|
||||||
}
|
}
|
||||||
void op(const vector<Mat>& src, Mat& dst, const Mat&)
|
void op(const vector<Mat>& src, Mat& dst, const Mat&)
|
||||||
{
|
{
|
||||||
@ -920,7 +922,7 @@ struct SetIdentityOp : public BaseElemWiseOp
|
|||||||
SetIdentityOp() : BaseElemWiseOp(0, FIX_ALPHA+FIX_BETA, 1, 1, Scalar::all(0)) {}
|
SetIdentityOp() : BaseElemWiseOp(0, FIX_ALPHA+FIX_BETA, 1, 1, Scalar::all(0)) {}
|
||||||
void getRandomSize(RNG& rng, vector<int>& size)
|
void getRandomSize(RNG& rng, vector<int>& size)
|
||||||
{
|
{
|
||||||
cvtest::randomSize(rng, 2, 2, cvtest::ARITHM_MAX_SIZE_LOG, size);
|
cvtest::randomSize(rng, 2, 2, ARITHM_MAX_SIZE_LOG, size);
|
||||||
}
|
}
|
||||||
void op(const vector<Mat>&, Mat& dst, const Mat&)
|
void op(const vector<Mat>&, Mat& dst, const Mat&)
|
||||||
{
|
{
|
||||||
@ -928,7 +930,7 @@ struct SetIdentityOp : public BaseElemWiseOp
|
|||||||
}
|
}
|
||||||
void refop(const vector<Mat>&, Mat& dst, const Mat&)
|
void refop(const vector<Mat>&, Mat& dst, const Mat&)
|
||||||
{
|
{
|
||||||
cvtest::setIdentity(dst, gamma);
|
reference::setIdentity(dst, gamma);
|
||||||
}
|
}
|
||||||
double getMaxErr(int)
|
double getMaxErr(int)
|
||||||
{
|
{
|
||||||
@ -953,7 +955,7 @@ struct SetZeroOp : public BaseElemWiseOp
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace reference {
|
||||||
static void exp(const Mat& src, Mat& dst)
|
static void exp(const Mat& src, Mat& dst)
|
||||||
{
|
{
|
||||||
dst.create( src.dims, &src.size[0], src.type() );
|
dst.create( src.dims, &src.size[0], src.type() );
|
||||||
@ -1012,6 +1014,8 @@ static void log(const Mat& src, Mat& dst)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
struct ExpOp : public BaseElemWiseOp
|
struct ExpOp : public BaseElemWiseOp
|
||||||
{
|
{
|
||||||
ExpOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
|
ExpOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
|
||||||
@ -1030,7 +1034,7 @@ struct ExpOp : public BaseElemWiseOp
|
|||||||
}
|
}
|
||||||
void refop(const vector<Mat>& src, Mat& dst, const Mat&)
|
void refop(const vector<Mat>& src, Mat& dst, const Mat&)
|
||||||
{
|
{
|
||||||
cvtest::exp(src[0], dst);
|
reference::exp(src[0], dst);
|
||||||
}
|
}
|
||||||
double getMaxErr(int depth)
|
double getMaxErr(int depth)
|
||||||
{
|
{
|
||||||
@ -1054,14 +1058,14 @@ struct LogOp : public BaseElemWiseOp
|
|||||||
void op(const vector<Mat>& src, Mat& dst, const Mat&)
|
void op(const vector<Mat>& src, Mat& dst, const Mat&)
|
||||||
{
|
{
|
||||||
Mat temp;
|
Mat temp;
|
||||||
cvtest::exp(src[0], temp);
|
reference::exp(src[0], temp);
|
||||||
cv::log(temp, dst);
|
cv::log(temp, dst);
|
||||||
}
|
}
|
||||||
void refop(const vector<Mat>& src, Mat& dst, const Mat&)
|
void refop(const vector<Mat>& src, Mat& dst, const Mat&)
|
||||||
{
|
{
|
||||||
Mat temp;
|
Mat temp;
|
||||||
cvtest::exp(src[0], temp);
|
reference::exp(src[0], temp);
|
||||||
cvtest::log(temp, dst);
|
reference::log(temp, dst);
|
||||||
}
|
}
|
||||||
double getMaxErr(int depth)
|
double getMaxErr(int depth)
|
||||||
{
|
{
|
||||||
@ -1070,6 +1074,7 @@ struct LogOp : public BaseElemWiseOp
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
namespace reference {
|
||||||
static void cartToPolar(const Mat& mx, const Mat& my, Mat& mmag, Mat& mangle, bool angleInDegrees)
|
static void cartToPolar(const Mat& mx, const Mat& my, Mat& mmag, Mat& mangle, bool angleInDegrees)
|
||||||
{
|
{
|
||||||
CV_Assert( (mx.type() == CV_32F || mx.type() == CV_64F) &&
|
CV_Assert( (mx.type() == CV_32F || mx.type() == CV_64F) &&
|
||||||
@ -1120,6 +1125,7 @@ static void cartToPolar(const Mat& mx, const Mat& my, Mat& mmag, Mat& mangle, bo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
struct CartToPolarToCartOp : public BaseElemWiseOp
|
struct CartToPolarToCartOp : public BaseElemWiseOp
|
||||||
{
|
{
|
||||||
@ -1147,7 +1153,7 @@ struct CartToPolarToCartOp : public BaseElemWiseOp
|
|||||||
void refop(const vector<Mat>& src, Mat& dst, const Mat&)
|
void refop(const vector<Mat>& src, Mat& dst, const Mat&)
|
||||||
{
|
{
|
||||||
Mat mag, angle;
|
Mat mag, angle;
|
||||||
cvtest::cartToPolar(src[0], src[1], mag, angle, angleInDegrees);
|
reference::cartToPolar(src[0], src[1], mag, angle, angleInDegrees);
|
||||||
Mat msrc[] = {mag, angle, src[0], src[1]};
|
Mat msrc[] = {mag, angle, src[0], src[1]};
|
||||||
int pairs[] = {0, 0, 1, 1, 2, 2, 3, 3};
|
int pairs[] = {0, 0, 1, 1, 2, 2, 3, 3};
|
||||||
dst.create(src[0].dims, src[0].size, CV_MAKETYPE(src[0].depth(), 4));
|
dst.create(src[0].dims, src[0].size, CV_MAKETYPE(src[0].depth(), 4));
|
||||||
@ -1382,9 +1388,7 @@ struct MinMaxLocOp : public BaseElemWiseOp
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
typedef Ptr<BaseElemWiseOp> ElemWiseOpPtr;
|
||||||
|
|
||||||
typedef Ptr<cvtest::BaseElemWiseOp> ElemWiseOpPtr;
|
|
||||||
class ElemWiseTest : public ::testing::TestWithParam<ElemWiseOpPtr> {};
|
class ElemWiseTest : public ::testing::TestWithParam<ElemWiseOpPtr> {};
|
||||||
|
|
||||||
TEST_P(ElemWiseTest, accuracy)
|
TEST_P(ElemWiseTest, accuracy)
|
||||||
@ -1392,15 +1396,15 @@ TEST_P(ElemWiseTest, accuracy)
|
|||||||
ElemWiseOpPtr op = GetParam();
|
ElemWiseOpPtr op = GetParam();
|
||||||
|
|
||||||
int testIdx = 0;
|
int testIdx = 0;
|
||||||
RNG rng((uint64)cvtest::ARITHM_RNG_SEED);
|
RNG rng((uint64)ARITHM_RNG_SEED);
|
||||||
for( testIdx = 0; testIdx < cvtest::ARITHM_NTESTS; testIdx++ )
|
for( testIdx = 0; testIdx < ARITHM_NTESTS; testIdx++ )
|
||||||
{
|
{
|
||||||
vector<int> size;
|
vector<int> size;
|
||||||
op->getRandomSize(rng, size);
|
op->getRandomSize(rng, size);
|
||||||
int type = op->getRandomType(rng);
|
int type = op->getRandomType(rng);
|
||||||
int depth = CV_MAT_DEPTH(type);
|
int depth = CV_MAT_DEPTH(type);
|
||||||
bool haveMask = ((op->flags & cvtest::BaseElemWiseOp::SUPPORT_MASK) != 0
|
bool haveMask = ((op->flags & BaseElemWiseOp::SUPPORT_MASK) != 0
|
||||||
|| (op->flags & cvtest::BaseElemWiseOp::SUPPORT_MULTICHANNELMASK) != 0) && rng.uniform(0, 4) == 0;
|
|| (op->flags & BaseElemWiseOp::SUPPORT_MULTICHANNELMASK) != 0) && rng.uniform(0, 4) == 0;
|
||||||
|
|
||||||
double minval=0, maxval=0;
|
double minval=0, maxval=0;
|
||||||
op->getValueRange(depth, minval, maxval);
|
op->getValueRange(depth, minval, maxval);
|
||||||
@ -1410,13 +1414,13 @@ TEST_P(ElemWiseTest, accuracy)
|
|||||||
src[i] = cvtest::randomMat(rng, size, type, minval, maxval, true);
|
src[i] = cvtest::randomMat(rng, size, type, minval, maxval, true);
|
||||||
Mat dst0, dst, mask;
|
Mat dst0, dst, mask;
|
||||||
if( haveMask ) {
|
if( haveMask ) {
|
||||||
bool multiChannelMask = (op->flags & cvtest::BaseElemWiseOp::SUPPORT_MULTICHANNELMASK) != 0
|
bool multiChannelMask = (op->flags & BaseElemWiseOp::SUPPORT_MULTICHANNELMASK) != 0
|
||||||
&& rng.uniform(0, 2) == 0;
|
&& rng.uniform(0, 2) == 0;
|
||||||
int masktype = CV_8UC(multiChannelMask ? CV_MAT_CN(type) : 1);
|
int masktype = CV_8UC(multiChannelMask ? CV_MAT_CN(type) : 1);
|
||||||
mask = cvtest::randomMat(rng, size, masktype, 0, 2, true);
|
mask = cvtest::randomMat(rng, size, masktype, 0, 2, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( (haveMask || ninputs == 0) && !(op->flags & cvtest::BaseElemWiseOp::SCALAR_OUTPUT))
|
if( (haveMask || ninputs == 0) && !(op->flags & BaseElemWiseOp::SCALAR_OUTPUT))
|
||||||
{
|
{
|
||||||
dst0 = cvtest::randomMat(rng, size, type, minval, maxval, false);
|
dst0 = cvtest::randomMat(rng, size, type, minval, maxval, false);
|
||||||
dst = cvtest::randomMat(rng, size, type, minval, maxval, true);
|
dst = cvtest::randomMat(rng, size, type, minval, maxval, true);
|
||||||
@ -1434,61 +1438,61 @@ TEST_P(ElemWiseTest, accuracy)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Copy, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::CopyOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Copy, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new CopyOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Set, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::SetOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Set, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new SetOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_SetZero, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::SetZeroOp)));
|
INSTANTIATE_TEST_CASE_P(Core_SetZero, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new SetZeroOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_ConvertScale, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::ConvertScaleOp)));
|
INSTANTIATE_TEST_CASE_P(Core_ConvertScale, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new ConvertScaleOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_ConvertScaleFp16, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::ConvertScaleFp16Op)));
|
INSTANTIATE_TEST_CASE_P(Core_ConvertScaleFp16, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new ConvertScaleFp16Op)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_ConvertScaleAbs, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::ConvertScaleAbsOp)));
|
INSTANTIATE_TEST_CASE_P(Core_ConvertScaleAbs, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new ConvertScaleAbsOp)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Add, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::AddOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Add, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new AddOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Sub, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::SubOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Sub, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new SubOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_AddS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::AddSOp)));
|
INSTANTIATE_TEST_CASE_P(Core_AddS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new AddSOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_SubRS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::SubRSOp)));
|
INSTANTIATE_TEST_CASE_P(Core_SubRS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new SubRSOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_ScaleAdd, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::ScaleAddOp)));
|
INSTANTIATE_TEST_CASE_P(Core_ScaleAdd, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new ScaleAddOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_AddWeighted, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::AddWeightedOp)));
|
INSTANTIATE_TEST_CASE_P(Core_AddWeighted, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new AddWeightedOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_AbsDiff, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::AbsDiffOp)));
|
INSTANTIATE_TEST_CASE_P(Core_AbsDiff, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new AbsDiffOp)));
|
||||||
|
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Core_AbsDiffS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::AbsDiffSOp)));
|
INSTANTIATE_TEST_CASE_P(Core_AbsDiffS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new AbsDiffSOp)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Core_And, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::LogicOp('&'))));
|
INSTANTIATE_TEST_CASE_P(Core_And, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new LogicOp('&'))));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_AndS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::LogicSOp('&'))));
|
INSTANTIATE_TEST_CASE_P(Core_AndS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new LogicSOp('&'))));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Or, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::LogicOp('|'))));
|
INSTANTIATE_TEST_CASE_P(Core_Or, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new LogicOp('|'))));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_OrS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::LogicSOp('|'))));
|
INSTANTIATE_TEST_CASE_P(Core_OrS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new LogicSOp('|'))));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Xor, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::LogicOp('^'))));
|
INSTANTIATE_TEST_CASE_P(Core_Xor, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new LogicOp('^'))));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_XorS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::LogicSOp('^'))));
|
INSTANTIATE_TEST_CASE_P(Core_XorS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new LogicSOp('^'))));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Not, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::LogicSOp('~'))));
|
INSTANTIATE_TEST_CASE_P(Core_Not, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new LogicSOp('~'))));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Max, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::MaxOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Max, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new MaxOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_MaxS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::MaxSOp)));
|
INSTANTIATE_TEST_CASE_P(Core_MaxS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new MaxSOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Min, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::MinOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Min, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new MinOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_MinS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::MinSOp)));
|
INSTANTIATE_TEST_CASE_P(Core_MinS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new MinSOp)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Mul, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::MulOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Mul, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new MulOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Div, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::DivOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Div, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new DivOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Recip, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::RecipOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Recip, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new RecipOp)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Cmp, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::CmpOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Cmp, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new CmpOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_CmpS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::CmpSOp)));
|
INSTANTIATE_TEST_CASE_P(Core_CmpS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new CmpSOp)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Core_InRangeS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::InRangeSOp)));
|
INSTANTIATE_TEST_CASE_P(Core_InRangeS, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new InRangeSOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_InRange, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::InRangeOp)));
|
INSTANTIATE_TEST_CASE_P(Core_InRange, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new InRangeOp)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Flip, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::FlipOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Flip, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new FlipOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Transpose, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::TransposeOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Transpose, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new TransposeOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_SetIdentity, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::SetIdentityOp)));
|
INSTANTIATE_TEST_CASE_P(Core_SetIdentity, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new SetIdentityOp)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Exp, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::ExpOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Exp, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new ExpOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Log, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::LogOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Log, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new LogOp)));
|
||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Core_CountNonZero, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::CountNonZeroOp)));
|
INSTANTIATE_TEST_CASE_P(Core_CountNonZero, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new CountNonZeroOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Mean, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::MeanOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Mean, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new MeanOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_MeanStdDev, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::MeanStdDevOp)));
|
INSTANTIATE_TEST_CASE_P(Core_MeanStdDev, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new MeanStdDevOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Sum, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::SumOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Sum, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new SumOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_Norm, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::NormOp)));
|
INSTANTIATE_TEST_CASE_P(Core_Norm, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new NormOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_MinMaxLoc, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::MinMaxLocOp)));
|
INSTANTIATE_TEST_CASE_P(Core_MinMaxLoc, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new MinMaxLocOp)));
|
||||||
INSTANTIATE_TEST_CASE_P(Core_CartToPolarToCart, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new cvtest::CartToPolarToCartOp)));
|
INSTANTIATE_TEST_CASE_P(Core_CartToPolarToCart, ElemWiseTest, ::testing::Values(ElemWiseOpPtr(new CartToPolarToCartOp)));
|
||||||
|
|
||||||
|
|
||||||
TEST(Core_ArithmMask, uninitialized)
|
TEST(Core_ArithmMask, uninitialized)
|
||||||
@ -1528,34 +1532,34 @@ TEST(Core_ArithmMask, uninitialized)
|
|||||||
a.convertTo(a1, depth1);
|
a.convertTo(a1, depth1);
|
||||||
b.convertTo(b1, depth1);
|
b.convertTo(b1, depth1);
|
||||||
// invert the mask
|
// invert the mask
|
||||||
compare(mask, 0, mask1, CMP_EQ);
|
cv::compare(mask, 0, mask1, CMP_EQ);
|
||||||
a1.setTo(0, mask1);
|
a1.setTo(0, mask1);
|
||||||
b1.setTo(0, mask1);
|
b1.setTo(0, mask1);
|
||||||
|
|
||||||
if( op == 0 )
|
if( op == 0 )
|
||||||
{
|
{
|
||||||
add(a, b, c, mask);
|
cv::add(a, b, c, mask);
|
||||||
add(a1, b1, d);
|
cv::add(a1, b1, d);
|
||||||
}
|
}
|
||||||
else if( op == 1 )
|
else if( op == 1 )
|
||||||
{
|
{
|
||||||
subtract(a, b, c, mask);
|
cv::subtract(a, b, c, mask);
|
||||||
subtract(a1, b1, d);
|
cv::subtract(a1, b1, d);
|
||||||
}
|
}
|
||||||
else if( op == 2 )
|
else if( op == 2 )
|
||||||
{
|
{
|
||||||
bitwise_and(a, b, c, mask);
|
cv::bitwise_and(a, b, c, mask);
|
||||||
bitwise_and(a1, b1, d);
|
cv::bitwise_and(a1, b1, d);
|
||||||
}
|
}
|
||||||
else if( op == 3 )
|
else if( op == 3 )
|
||||||
{
|
{
|
||||||
bitwise_or(a, b, c, mask);
|
cv::bitwise_or(a, b, c, mask);
|
||||||
bitwise_or(a1, b1, d);
|
cv::bitwise_or(a1, b1, d);
|
||||||
}
|
}
|
||||||
else if( op == 4 )
|
else if( op == 4 )
|
||||||
{
|
{
|
||||||
bitwise_xor(a, b, c, mask);
|
cv::bitwise_xor(a, b, c, mask);
|
||||||
bitwise_xor(a1, b1, d);
|
cv::bitwise_xor(a1, b1, d);
|
||||||
}
|
}
|
||||||
Mat d1;
|
Mat d1;
|
||||||
d.convertTo(d1, depth);
|
d.convertTo(d1, depth);
|
||||||
@ -1630,7 +1634,7 @@ TEST_P(Mul1, One)
|
|||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Arithm, Mul1, testing::Values(Size(2, 2), Size(1, 1)));
|
INSTANTIATE_TEST_CASE_P(Arithm, Mul1, testing::Values(Size(2, 2), Size(1, 1)));
|
||||||
|
|
||||||
class SubtractOutputMatNotEmpty : public testing::TestWithParam< std::tr1::tuple<cv::Size, perf::MatType, perf::MatDepth, bool> >
|
class SubtractOutputMatNotEmpty : public testing::TestWithParam< tuple<cv::Size, perf::MatType, perf::MatDepth, bool> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cv::Size size;
|
cv::Size size;
|
||||||
@ -1640,10 +1644,10 @@ public:
|
|||||||
|
|
||||||
void SetUp()
|
void SetUp()
|
||||||
{
|
{
|
||||||
size = std::tr1::get<0>(GetParam());
|
size = get<0>(GetParam());
|
||||||
src_type = std::tr1::get<1>(GetParam());
|
src_type = get<1>(GetParam());
|
||||||
dst_depth = std::tr1::get<2>(GetParam());
|
dst_depth = get<2>(GetParam());
|
||||||
fixed = std::tr1::get<3>(GetParam());
|
fixed = get<3>(GetParam());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1864,13 +1868,13 @@ TEST(Core_BoolVector, support)
|
|||||||
nz += (int)test[i];
|
nz += (int)test[i];
|
||||||
}
|
}
|
||||||
ASSERT_EQ( nz, countNonZero(test) );
|
ASSERT_EQ( nz, countNonZero(test) );
|
||||||
ASSERT_FLOAT_EQ((float)nz/n, (float)(mean(test)[0]));
|
ASSERT_FLOAT_EQ((float)nz/n, (float)(cv::mean(test)[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(MinMaxLoc, Mat_UcharMax_Without_Loc)
|
TEST(MinMaxLoc, Mat_UcharMax_Without_Loc)
|
||||||
{
|
{
|
||||||
Mat_<uchar> mat(50, 50);
|
Mat_<uchar> mat(50, 50);
|
||||||
uchar iMaxVal = numeric_limits<uchar>::max();
|
uchar iMaxVal = std::numeric_limits<uchar>::max();
|
||||||
mat.setTo(iMaxVal);
|
mat.setTo(iMaxVal);
|
||||||
|
|
||||||
double min, max;
|
double min, max;
|
||||||
@ -1888,7 +1892,7 @@ TEST(MinMaxLoc, Mat_UcharMax_Without_Loc)
|
|||||||
TEST(MinMaxLoc, Mat_IntMax_Without_Mask)
|
TEST(MinMaxLoc, Mat_IntMax_Without_Mask)
|
||||||
{
|
{
|
||||||
Mat_<int> mat(50, 50);
|
Mat_<int> mat(50, 50);
|
||||||
int iMaxVal = numeric_limits<int>::max();
|
int iMaxVal = std::numeric_limits<int>::max();
|
||||||
mat.setTo(iMaxVal);
|
mat.setTo(iMaxVal);
|
||||||
|
|
||||||
double min, max;
|
double min, max;
|
||||||
@ -1957,8 +1961,8 @@ TEST(Compare, regression_8999)
|
|||||||
Mat_<double> B(1,1); B << 2;
|
Mat_<double> B(1,1); B << 2;
|
||||||
Mat C;
|
Mat C;
|
||||||
ASSERT_ANY_THROW({
|
ASSERT_ANY_THROW({
|
||||||
compare(A, B, C, CMP_LT);
|
cv::compare(A, B, C, CMP_LT);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1982,7 +1986,7 @@ TEST(Core_minMaxIdx, regression_9207_1)
|
|||||||
Mat src(Size(cols, rows), CV_8UC1, src_);
|
Mat src(Size(cols, rows), CV_8UC1, src_);
|
||||||
double minVal = -0.0, maxVal = -0.0;
|
double minVal = -0.0, maxVal = -0.0;
|
||||||
int minIdx[2] = { -2, -2 }, maxIdx[2] = { -2, -2 };
|
int minIdx[2] = { -2, -2 }, maxIdx[2] = { -2, -2 };
|
||||||
minMaxIdx(src, &minVal, &maxVal, minIdx, maxIdx, mask);
|
cv::minMaxIdx(src, &minVal, &maxVal, minIdx, maxIdx, mask);
|
||||||
EXPECT_EQ(0, minIdx[0]);
|
EXPECT_EQ(0, minIdx[0]);
|
||||||
EXPECT_EQ(0, minIdx[1]);
|
EXPECT_EQ(0, minIdx[1]);
|
||||||
EXPECT_EQ(0, maxIdx[0]);
|
EXPECT_EQ(0, maxIdx[0]);
|
||||||
@ -2028,9 +2032,11 @@ TEST(Core_minMaxIdx, regression_9207_2)
|
|||||||
Mat src(Size(cols, rows), CV_8UC1, src_);
|
Mat src(Size(cols, rows), CV_8UC1, src_);
|
||||||
double minVal = -0.0, maxVal = -0.0;
|
double minVal = -0.0, maxVal = -0.0;
|
||||||
int minIdx[2] = { -2, -2 }, maxIdx[2] = { -2, -2 };
|
int minIdx[2] = { -2, -2 }, maxIdx[2] = { -2, -2 };
|
||||||
minMaxIdx(src, &minVal, &maxVal, minIdx, maxIdx, mask);
|
cv::minMaxIdx(src, &minVal, &maxVal, minIdx, maxIdx, mask);
|
||||||
EXPECT_EQ(0, minIdx[0]);
|
EXPECT_EQ(0, minIdx[0]);
|
||||||
EXPECT_EQ(14, minIdx[1]);
|
EXPECT_EQ(14, minIdx[1]);
|
||||||
EXPECT_EQ(0, maxIdx[0]);
|
EXPECT_EQ(0, maxIdx[0]);
|
||||||
EXPECT_EQ(14, maxIdx[1]);
|
EXPECT_EQ(14, maxIdx[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -41,8 +41,7 @@
|
|||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Core_ConcatenationTest : public cvtest::BaseTest
|
class Core_ConcatenationTest : public cvtest::BaseTest
|
||||||
{
|
{
|
||||||
@ -145,3 +144,5 @@ TEST(Core_Concatenation, hconcat_empty_empty) { Core_ConcatenationTest test(true
|
|||||||
TEST(Core_Concatenation, vconcat_empty_nonempty) { Core_ConcatenationTest test(false, true, false); test.safe_run(); }
|
TEST(Core_Concatenation, vconcat_empty_nonempty) { Core_ConcatenationTest test(false, true, false); test.safe_run(); }
|
||||||
TEST(Core_Concatenation, vconcat_nonempty_empty) { Core_ConcatenationTest test(false, false, true); test.safe_run(); }
|
TEST(Core_Concatenation, vconcat_nonempty_empty) { Core_ConcatenationTest test(false, false, true); test.safe_run(); }
|
||||||
TEST(Core_Concatenation, vconcat_empty_empty) { Core_ConcatenationTest test(false, true, true); test.safe_run(); }
|
TEST(Core_Concatenation, vconcat_empty_empty) { Core_ConcatenationTest test(false, true, true); test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -39,7 +39,8 @@
|
|||||||
//
|
//
|
||||||
//M*/
|
//M*/
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include <cstdlib>
|
|
||||||
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
static void mytest(cv::Ptr<cv::ConjGradSolver> solver,cv::Ptr<cv::MinProblemSolver::Function> ptr_F,cv::Mat& x,
|
static void mytest(cv::Ptr<cv::ConjGradSolver> solver,cv::Ptr<cv::MinProblemSolver::Function> ptr_F,cv::Mat& x,
|
||||||
cv::Mat& etalon_x,double etalon_res){
|
cv::Mat& etalon_x,double etalon_res){
|
||||||
@ -103,3 +104,5 @@ TEST(Core_ConjGradSolver, regression_basic){
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -41,10 +41,8 @@
|
|||||||
//M*/
|
//M*/
|
||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include <time.h>
|
|
||||||
#include <limits>
|
namespace opencv_test { namespace {
|
||||||
using namespace cv;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#define CORE_COUNTNONZERO_ERROR_COUNT 1
|
#define CORE_COUNTNONZERO_ERROR_COUNT 1
|
||||||
|
|
||||||
@ -252,12 +250,12 @@ void CV_CountNonZeroTest::run(int)
|
|||||||
TEST (Core_CountNonZero, accuracy) { CV_CountNonZeroTest test; test.safe_run(); }
|
TEST (Core_CountNonZero, accuracy) { CV_CountNonZeroTest test; test.safe_run(); }
|
||||||
|
|
||||||
|
|
||||||
typedef testing::TestWithParam<std::tr1::tuple<int, int> > CountNonZeroND;
|
typedef testing::TestWithParam<tuple<int, int> > CountNonZeroND;
|
||||||
|
|
||||||
TEST_P (CountNonZeroND, ndim)
|
TEST_P (CountNonZeroND, ndim)
|
||||||
{
|
{
|
||||||
const int dims = std::tr1::get<0>(GetParam());
|
const int dims = get<0>(GetParam());
|
||||||
const int type = std::tr1::get<1>(GetParam());
|
const int type = get<1>(GetParam());
|
||||||
const int ONE_SIZE = 5;
|
const int ONE_SIZE = 5;
|
||||||
|
|
||||||
vector<int> sizes(dims);
|
vector<int> sizes(dims);
|
||||||
@ -277,3 +275,5 @@ INSTANTIATE_TEST_CASE_P(Core, CountNonZeroND,
|
|||||||
testing::Values(CV_8U, CV_8S, CV_32F)
|
testing::Values(CV_8U, CV_8S, CV_32F)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -39,9 +39,8 @@
|
|||||||
//
|
//
|
||||||
//M*/
|
//M*/
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include <cstdlib>
|
|
||||||
#include <cmath>
|
namespace opencv_test { namespace {
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
static void mytest(cv::Ptr<cv::DownhillSolver> solver,cv::Ptr<cv::MinProblemSolver::Function> ptr_F,cv::Mat& x,cv::Mat& step,
|
static void mytest(cv::Ptr<cv::DownhillSolver> solver,cv::Ptr<cv::MinProblemSolver::Function> ptr_F,cv::Mat& x,cv::Mat& step,
|
||||||
cv::Mat& etalon_x,double etalon_res){
|
cv::Mat& etalon_x,double etalon_res){
|
||||||
@ -103,3 +102,5 @@ TEST(Core_DownhillSolver, regression_basic){
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
typedef struct CvTsSimpleSeq
|
typedef struct CvTsSimpleSeq
|
||||||
{
|
{
|
||||||
@ -2130,3 +2132,5 @@ TEST(Core_DS_Seq, sort_invert) { Core_SeqSortInvTest test; test.safe_run(); }
|
|||||||
TEST(Core_DS_Set, basic_operations) { Core_SetTest test; test.safe_run(); }
|
TEST(Core_DS_Set, basic_operations) { Core_SetTest test; test.safe_run(); }
|
||||||
TEST(Core_DS_Graph, basic_operations) { Core_GraphTest test; test.safe_run(); }
|
TEST(Core_DS_Graph, basic_operations) { Core_GraphTest test; test.safe_run(); }
|
||||||
TEST(Core_DS_Graph, scan) { Core_GraphScanTest test; test.safe_run(); }
|
TEST(Core_DS_Graph, scan) { Core_GraphScanTest test; test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace cvtest
|
|
||||||
{
|
|
||||||
|
|
||||||
static Mat initDFTWave( int n, bool inv )
|
static Mat initDFTWave( int n, bool inv )
|
||||||
{
|
{
|
||||||
@ -497,9 +496,6 @@ static void mulComplex( const Mat& src1, const Mat& src2, Mat& dst, int flags )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class CxCore_DXTBaseTest : public cvtest::ArrayTest
|
class CxCore_DXTBaseTest : public cvtest::ArrayTest
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -661,7 +657,7 @@ int CxCore_DXTBaseTest::prepare_test_case( int test_case_idx )
|
|||||||
int out_type = test_mat[OUTPUT][0].type();
|
int out_type = test_mat[OUTPUT][0].type();
|
||||||
|
|
||||||
if( CV_MAT_CN(in_type) == 2 && CV_MAT_CN(out_type) == 1 )
|
if( CV_MAT_CN(in_type) == 2 && CV_MAT_CN(out_type) == 1 )
|
||||||
cvtest::fixCCS( test_mat[INPUT][0], test_mat[OUTPUT][0].cols, flags );
|
fixCCS( test_mat[INPUT][0], test_mat[OUTPUT][0].cols, flags );
|
||||||
|
|
||||||
if( inplace )
|
if( inplace )
|
||||||
cvtest::copy( test_mat[INPUT][test_case_idx & (int)spectrum_mode],
|
cvtest::copy( test_mat[INPUT][test_case_idx & (int)spectrum_mode],
|
||||||
@ -718,22 +714,22 @@ void CxCore_DFTTest::prepare_to_validation( int /*test_case_idx*/ )
|
|||||||
if( !(flags & CV_DXT_INVERSE ) )
|
if( !(flags & CV_DXT_INVERSE ) )
|
||||||
{
|
{
|
||||||
Mat& cvdft_dst = test_mat[TEMP][1];
|
Mat& cvdft_dst = test_mat[TEMP][1];
|
||||||
cvtest::convertFromCCS( cvdft_dst, cvdft_dst,
|
convertFromCCS( cvdft_dst, cvdft_dst,
|
||||||
test_mat[OUTPUT][0], flags );
|
test_mat[OUTPUT][0], flags );
|
||||||
*tmp_src = Scalar::all(0);
|
*tmp_src = Scalar::all(0);
|
||||||
cvtest::insert( src, *tmp_src, 0 );
|
cvtest::insert( src, *tmp_src, 0 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cvtest::convertFromCCS( src, src, *tmp_src, flags );
|
convertFromCCS( src, src, *tmp_src, flags );
|
||||||
tmp_dst = &test_mat[TEMP][1];
|
tmp_dst = &test_mat[TEMP][1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( src.rows == 1 || (src.cols == 1 && !(flags & CV_DXT_ROWS)) )
|
if( src.rows == 1 || (src.cols == 1 && !(flags & CV_DXT_ROWS)) )
|
||||||
cvtest::DFT_1D( *tmp_src, *tmp_dst, flags );
|
DFT_1D( *tmp_src, *tmp_dst, flags );
|
||||||
else
|
else
|
||||||
cvtest::DFT_2D( *tmp_src, *tmp_dst, flags );
|
DFT_2D( *tmp_src, *tmp_dst, flags );
|
||||||
|
|
||||||
if( tmp_dst != &dst )
|
if( tmp_dst != &dst )
|
||||||
cvtest::extract( *tmp_dst, dst, 0 );
|
cvtest::extract( *tmp_dst, dst, 0 );
|
||||||
@ -773,9 +769,9 @@ void CxCore_DCTTest::prepare_to_validation( int /*test_case_idx*/ )
|
|||||||
Mat& dst = test_mat[REF_OUTPUT][0];
|
Mat& dst = test_mat[REF_OUTPUT][0];
|
||||||
|
|
||||||
if( src.rows == 1 || (src.cols == 1 && !(flags & CV_DXT_ROWS)) )
|
if( src.rows == 1 || (src.cols == 1 && !(flags & CV_DXT_ROWS)) )
|
||||||
cvtest::DCT_1D( src, dst, flags );
|
DCT_1D( src, dst, flags );
|
||||||
else
|
else
|
||||||
cvtest::DCT_2D( src, dst, flags );
|
DCT_2D( src, dst, flags );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -837,17 +833,17 @@ void CxCore_MulSpectrumsTest::prepare_to_validation( int /*test_case_idx*/ )
|
|||||||
|
|
||||||
if( cn == 1 )
|
if( cn == 1 )
|
||||||
{
|
{
|
||||||
cvtest::convertFromCCS( *src1, *src1, dst, flags );
|
convertFromCCS( *src1, *src1, dst, flags );
|
||||||
cvtest::convertFromCCS( *src2, *src2, dst0, flags );
|
convertFromCCS( *src2, *src2, dst0, flags );
|
||||||
src1 = &dst;
|
src1 = &dst;
|
||||||
src2 = &dst0;
|
src2 = &dst0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cvtest::mulComplex( *src1, *src2, dst0, flags );
|
mulComplex( *src1, *src2, dst0, flags );
|
||||||
if( cn == 1 )
|
if( cn == 1 )
|
||||||
{
|
{
|
||||||
Mat& temp = test_mat[TEMP][0];
|
Mat& temp = test_mat[TEMP][0];
|
||||||
cvtest::convertFromCCS( temp, temp, dst, flags );
|
convertFromCCS( temp, temp, dst, flags );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -900,7 +896,7 @@ TEST(Core_DFT, complex_output2)
|
|||||||
Mat x(m, n, type), out;
|
Mat x(m, n, type), out;
|
||||||
randu(x, -1., 1.);
|
randu(x, -1., 1.);
|
||||||
dft(x, out, DFT_ROWS | DFT_COMPLEX_OUTPUT);
|
dft(x, out, DFT_ROWS | DFT_COMPLEX_OUTPUT);
|
||||||
double nrm = norm(out, NORM_INF);
|
double nrm = cvtest::norm(out, NORM_INF);
|
||||||
double thresh = n*m*2;
|
double thresh = n*m*2;
|
||||||
if( nrm > thresh )
|
if( nrm > thresh )
|
||||||
{
|
{
|
||||||
@ -986,3 +982,5 @@ protected:
|
|||||||
|
|
||||||
TEST(Core_DFT, reverse) { Core_DXTReverseTest test(Core_DXTReverseTest::ModeDFT); test.safe_run(); }
|
TEST(Core_DFT, reverse) { Core_DXTReverseTest test(Core_DXTReverseTest::ModeDFT); test.safe_run(); }
|
||||||
TEST(Core_DCT, reverse) { Core_DXTReverseTest test(Core_DXTReverseTest::ModeDCT); test.safe_run(); }
|
TEST(Core_DCT, reverse) { Core_DXTReverseTest test(Core_DXTReverseTest::ModeDCT); test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -39,12 +39,9 @@
|
|||||||
// the use of this software, even if advised of the possibility of such damage.
|
// the use of this software, even if advised of the possibility of such damage.
|
||||||
//
|
//
|
||||||
//M*/
|
//M*/
|
||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#define sign(a) a > 0 ? 1 : a == 0 ? 0 : -1
|
#define sign(a) a > 0 ? 1 : a == 0 ? 0 : -1
|
||||||
|
|
||||||
@ -374,7 +371,7 @@ bool Core_EigenTest::check_full(int type)
|
|||||||
{
|
{
|
||||||
const int MAX_DEGREE = 7;
|
const int MAX_DEGREE = 7;
|
||||||
|
|
||||||
RNG rng = ::theRNG(); // fix the seed
|
RNG rng = cv::theRNG(); // fix the seed
|
||||||
|
|
||||||
for (int i = 0; i < ntests; ++i)
|
for (int i = 0; i < ntests; ++i)
|
||||||
{
|
{
|
||||||
@ -518,3 +515,5 @@ static void testEigen3x3()
|
|||||||
}
|
}
|
||||||
TEST(Core_EigenNonSymmetric, float3x3) { testEigen3x3<float>(); }
|
TEST(Core_EigenNonSymmetric, float3x3) { testEigen3x3<float>(); }
|
||||||
TEST(Core_EigenNonSymmetric, double3x3) { testEigen3x3<double>(); }
|
TEST(Core_EigenNonSymmetric, double3x3) { testEigen3x3<double>(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -38,10 +38,9 @@
|
|||||||
// the use of this software, even if advised of the possibility of such damage.
|
// the use of this software, even if advised of the possibility of such damage.
|
||||||
//
|
//
|
||||||
//M*/
|
//M*/
|
||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -111,7 +110,7 @@ TEST(Core_HAL, mathfuncs)
|
|||||||
t = (double)getTickCount() - t;
|
t = (double)getTickCount() - t;
|
||||||
min_ocv_t = std::min(min_ocv_t, t);
|
min_ocv_t = std::min(min_ocv_t, t);
|
||||||
}
|
}
|
||||||
EXPECT_LE(norm(dst, dst0, NORM_INF | NORM_RELATIVE), eps);
|
EXPECT_LE(cvtest::norm(dst, dst0, NORM_INF | NORM_RELATIVE), eps);
|
||||||
|
|
||||||
double freq = getTickFrequency();
|
double freq = getTickFrequency();
|
||||||
printf("%s (N=%d, %s): hal time=%.2fusec, ocv time=%.2fusec\n",
|
printf("%s (N=%d, %s): hal time=%.2fusec, ocv time=%.2fusec\n",
|
||||||
@ -120,8 +119,6 @@ TEST(Core_HAL, mathfuncs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
HAL_LU = 0,
|
HAL_LU = 0,
|
||||||
@ -188,7 +185,7 @@ TEST_P(HAL, mat_decomp)
|
|||||||
//std::cout << "x: " << Mat(x.t()) << std::endl;
|
//std::cout << "x: " << Mat(x.t()) << std::endl;
|
||||||
//std::cout << "x0: " << Mat(x0.t()) << std::endl;
|
//std::cout << "x0: " << Mat(x0.t()) << std::endl;
|
||||||
|
|
||||||
EXPECT_LE(norm(x, x0, NORM_INF | NORM_RELATIVE), eps)
|
EXPECT_LE(cvtest::norm(x, x0, NORM_INF | NORM_RELATIVE), eps)
|
||||||
<< "x: " << Mat(x.t())
|
<< "x: " << Mat(x.t())
|
||||||
<< "\nx0: " << Mat(x0.t())
|
<< "\nx0: " << Mat(x0.t())
|
||||||
<< "\na0: " << a0
|
<< "\na0: " << a0
|
||||||
@ -205,4 +202,4 @@ TEST_P(HAL, mat_decomp)
|
|||||||
|
|
||||||
INSTANTIATE_TEST_CASE_P(Core, HAL, testing::Range(0, 16));
|
INSTANTIATE_TEST_CASE_P(Core, HAL, testing::Range(0, 16));
|
||||||
|
|
||||||
} // namespace
|
}} // namespace
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include <climits>
|
|
||||||
|
|
||||||
#include "test_intrin_utils.hpp"
|
#include "test_intrin_utils.hpp"
|
||||||
|
|
||||||
@ -10,7 +12,7 @@
|
|||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
|
|
||||||
namespace cvtest { namespace hal {
|
namespace opencv_test { namespace hal {
|
||||||
using namespace CV_CPU_OPTIMIZATION_NAMESPACE;
|
using namespace CV_CPU_OPTIMIZATION_NAMESPACE;
|
||||||
|
|
||||||
//============= 8-bit integer =====================================================================
|
//============= 8-bit integer =====================================================================
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "test_intrin_utils.hpp"
|
#include "test_intrin_utils.hpp"
|
||||||
|
|
||||||
namespace cvtest { namespace hal {
|
namespace opencv_test { namespace hal {
|
||||||
CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
|
CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
|
||||||
|
|
||||||
void test_hal_intrin_float16x4()
|
void test_hal_intrin_float16x4()
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
#include "opencv2/core/hal/intrin.hpp"
|
#include "opencv2/core/hal/intrin.hpp"
|
||||||
|
|
||||||
namespace cvtest { namespace hal {
|
namespace opencv_test { namespace hal {
|
||||||
CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
|
CV_CPU_OPTIMIZATION_NAMESPACE_BEGIN
|
||||||
|
|
||||||
void test_hal_intrin_float16x4();
|
void test_hal_intrin_float16x4();
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
static SparseMat cvTsGetRandomSparseMat(int dims, const int* sz, int type,
|
static SparseMat cvTsGetRandomSparseMat(int dims, const int* sz, int type,
|
||||||
int nzcount, double a, double b, RNG& rng)
|
int nzcount, double a, double b, RNG& rng)
|
||||||
@ -122,7 +124,7 @@ protected:
|
|||||||
exp(test_mat, test_mat);
|
exp(test_mat, test_mat);
|
||||||
Mat test_mat_scale(test_mat.size(), test_mat.type());
|
Mat test_mat_scale(test_mat.size(), test_mat.type());
|
||||||
rng0.fill(test_mat_scale, CV_RAND_UNI, Scalar::all(-1), Scalar::all(1));
|
rng0.fill(test_mat_scale, CV_RAND_UNI, Scalar::all(-1), Scalar::all(1));
|
||||||
multiply(test_mat, test_mat_scale, test_mat);
|
cv::multiply(test_mat, test_mat_scale, test_mat);
|
||||||
}
|
}
|
||||||
|
|
||||||
CvSeq* seq = cvCreateSeq(test_mat.type(), (int)sizeof(CvSeq),
|
CvSeq* seq = cvCreateSeq(test_mat.type(), (int)sizeof(CvSeq),
|
||||||
@ -158,7 +160,7 @@ protected:
|
|||||||
exp(test_mat_nd, test_mat_nd);
|
exp(test_mat_nd, test_mat_nd);
|
||||||
MatND test_mat_scale(test_mat_nd.dims, test_mat_nd.size, test_mat_nd.type());
|
MatND test_mat_scale(test_mat_nd.dims, test_mat_nd.size, test_mat_nd.type());
|
||||||
rng0.fill(test_mat_scale, CV_RAND_UNI, Scalar::all(-1), Scalar::all(1));
|
rng0.fill(test_mat_scale, CV_RAND_UNI, Scalar::all(-1), Scalar::all(1));
|
||||||
multiply(test_mat_nd, test_mat_scale, test_mat_nd);
|
cv::multiply(test_mat_nd, test_mat_scale, test_mat_nd);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ssz[] = {
|
int ssz[] = {
|
||||||
@ -387,8 +389,6 @@ protected:
|
|||||||
|
|
||||||
TEST(Core_InputOutput, write_read_consistency) { Core_IOTest test; test.safe_run(); }
|
TEST(Core_InputOutput, write_read_consistency) { Core_IOTest test; test.safe_run(); }
|
||||||
|
|
||||||
extern void testFormatter();
|
|
||||||
|
|
||||||
|
|
||||||
struct UserDefinedType
|
struct UserDefinedType
|
||||||
{
|
{
|
||||||
@ -1058,7 +1058,7 @@ TEST(Core_InputOutput, filestorage_vec_vec_io)
|
|||||||
|
|
||||||
for(size_t k = 0; k < testMats[j].size(); k++)
|
for(size_t k = 0; k < testMats[j].size(); k++)
|
||||||
{
|
{
|
||||||
ASSERT_TRUE(norm(outputMats[j][k] - testMats[j][k], NORM_INF) == 0);
|
ASSERT_TRUE(cvtest::norm(outputMats[j][k] - testMats[j][k], NORM_INF) == 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1597,7 +1597,7 @@ TEST(Core_InputOutput, FileStorage_free_file_after_exception)
|
|||||||
const std::string fileName = "FileStorage_free_file_after_exception_test.yml";
|
const std::string fileName = "FileStorage_free_file_after_exception_test.yml";
|
||||||
const std::string content = "%YAML:1.0\n cameraMatrix;:: !<tag:yaml.org,2002:opencv-matrix>\n";
|
const std::string content = "%YAML:1.0\n cameraMatrix;:: !<tag:yaml.org,2002:opencv-matrix>\n";
|
||||||
|
|
||||||
fstream testFile;
|
std::fstream testFile;
|
||||||
testFile.open(fileName.c_str(), std::fstream::out);
|
testFile.open(fileName.c_str(), std::fstream::out);
|
||||||
if(!testFile.is_open()) FAIL();
|
if(!testFile.is_open()) FAIL();
|
||||||
testFile << content;
|
testFile << content;
|
||||||
@ -1611,5 +1611,7 @@ TEST(Core_InputOutput, FileStorage_free_file_after_exception)
|
|||||||
catch (const std::exception&)
|
catch (const std::exception&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
ASSERT_EQ(std::remove(fileName.c_str()), 0);
|
ASSERT_EQ(0, std::remove(fileName.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "opencv2/ts/ocl_test.hpp"
|
#include "opencv2/ts/ocl_test.hpp"
|
||||||
|
|
||||||
@ -6,9 +9,9 @@
|
|||||||
|
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace cvtest;
|
using namespace opencv_test;
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
PARAM_TEST_CASE(IPPAsync, MatDepth, Channels, hppAccelType)
|
PARAM_TEST_CASE(IPPAsync, MatDepth, Channels, hppAccelType)
|
||||||
|
@ -39,7 +39,8 @@
|
|||||||
//
|
//
|
||||||
//M*/
|
//M*/
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include <iostream>
|
|
||||||
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
TEST(Core_LPSolver, regression_basic){
|
TEST(Core_LPSolver, regression_basic){
|
||||||
cv::Mat A,B,z,etalon_z;
|
cv::Mat A,B,z,etalon_z;
|
||||||
@ -139,3 +140,5 @@ TEST(Core_LPSolver, regression_cycling){
|
|||||||
//ASSERT_EQ(res,1);
|
//ASSERT_EQ(res,1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
#ifdef _MSC_VER
|
// This file is part of OpenCV project.
|
||||||
# if _MSC_VER >= 1700
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
# pragma warning(disable:4447) // Disable warning 'main' signature found without threading model
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
CV_TEST_MAIN("cv")
|
CV_TEST_MAIN("cv")
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
#include <map>
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
using namespace cv;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
|
|
||||||
class Core_ReduceTest : public cvtest::BaseTest
|
class Core_ReduceTest : public cvtest::BaseTest
|
||||||
{
|
{
|
||||||
@ -770,8 +769,8 @@ void Core_ArrayOpTest::run( int /* start_from */)
|
|||||||
SparseMat M( dims, size, depth );
|
SparseMat M( dims, size, depth );
|
||||||
map<string, double> M0;
|
map<string, double> M0;
|
||||||
|
|
||||||
int nz0 = (unsigned)rng % max(p/5,10);
|
int nz0 = (unsigned)rng % std::max(p/5,10);
|
||||||
nz0 = min(max(nz0, 1), p);
|
nz0 = std::min(std::max(nz0, 1), p);
|
||||||
all_vals.resize(nz0);
|
all_vals.resize(nz0);
|
||||||
all_vals2.resize(nz0);
|
all_vals2.resize(nz0);
|
||||||
Mat_<double> _all_vals(all_vals), _all_vals2(all_vals2);
|
Mat_<double> _all_vals(all_vals), _all_vals2(all_vals2);
|
||||||
@ -791,9 +790,9 @@ void Core_ArrayOpTest::run( int /* start_from */)
|
|||||||
}
|
}
|
||||||
|
|
||||||
minMaxLoc(_all_vals, &min_val, &max_val);
|
minMaxLoc(_all_vals, &min_val, &max_val);
|
||||||
double _norm0 = cvtest::norm(_all_vals, CV_C);
|
double _norm0 = cv/*test*/::norm(_all_vals, CV_C);
|
||||||
double _norm1 = cvtest::norm(_all_vals, CV_L1);
|
double _norm1 = cv/*test*/::norm(_all_vals, CV_L1);
|
||||||
double _norm2 = cvtest::norm(_all_vals, CV_L2);
|
double _norm2 = cv/*test*/::norm(_all_vals, CV_L2);
|
||||||
|
|
||||||
for( i = 0; i < nz0; i++ )
|
for( i = 0; i < nz0; i++ )
|
||||||
{
|
{
|
||||||
@ -828,9 +827,9 @@ void Core_ArrayOpTest::run( int /* start_from */)
|
|||||||
SparseMat M3; SparseMat(Md).convertTo(M3, Md.type(), 2);
|
SparseMat M3; SparseMat(Md).convertTo(M3, Md.type(), 2);
|
||||||
|
|
||||||
int nz1 = (int)M.nzcount(), nz2 = (int)M3.nzcount();
|
int nz1 = (int)M.nzcount(), nz2 = (int)M3.nzcount();
|
||||||
double norm0 = norm(M, CV_C);
|
double norm0 = cv/*test*/::norm(M, CV_C);
|
||||||
double norm1 = norm(M, CV_L1);
|
double norm1 = cv/*test*/::norm(M, CV_L1);
|
||||||
double norm2 = norm(M, CV_L2);
|
double norm2 = cv/*test*/::norm(M, CV_L2);
|
||||||
double eps = depth == CV_32F ? FLT_EPSILON*100 : DBL_EPSILON*1000;
|
double eps = depth == CV_32F ? FLT_EPSILON*100 : DBL_EPSILON*1000;
|
||||||
|
|
||||||
if( nz1 != nz0 || nz2 != nz0)
|
if( nz1 != nz0 || nz2 != nz0)
|
||||||
@ -851,8 +850,8 @@ void Core_ArrayOpTest::run( int /* start_from */)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int n = (unsigned)rng % max(p/5,10);
|
int n = (unsigned)rng % std::max(p/5,10);
|
||||||
n = min(max(n, 1), p) + nz0;
|
n = std::min(std::max(n, 1), p) + nz0;
|
||||||
|
|
||||||
for( i = 0; i < n; i++ )
|
for( i = 0; i < n; i++ )
|
||||||
{
|
{
|
||||||
@ -919,7 +918,7 @@ void Core_ArrayOpTest::run( int /* start_from */)
|
|||||||
int idx1[MAX_DIM], idx2[MAX_DIM];
|
int idx1[MAX_DIM], idx2[MAX_DIM];
|
||||||
double val1 = 0, val2 = 0;
|
double val1 = 0, val2 = 0;
|
||||||
M3 = SparseMat(Md);
|
M3 = SparseMat(Md);
|
||||||
minMaxLoc(M3, &val1, &val2, idx1, idx2);
|
cv::minMaxLoc(M3, &val1, &val2, idx1, idx2);
|
||||||
string s1 = idx2string(idx1, dims), s2 = idx2string(idx2, dims);
|
string s1 = idx2string(idx1, dims), s2 = idx2string(idx2, dims);
|
||||||
if( val1 != min_val || val2 != max_val || s1 != min_sidx || s2 != max_sidx )
|
if( val1 != min_val || val2 != max_val || s1 != min_sidx || s2 != max_sidx )
|
||||||
{
|
{
|
||||||
@ -930,7 +929,7 @@ void Core_ArrayOpTest::run( int /* start_from */)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
minMaxIdx(Md, &val1, &val2, idx1, idx2);
|
cv::minMaxIdx(Md, &val1, &val2, idx1, idx2);
|
||||||
s1 = idx2string(idx1, dims), s2 = idx2string(idx2, dims);
|
s1 = idx2string(idx1, dims), s2 = idx2string(idx2, dims);
|
||||||
if( (min_val < 0 && (val1 != min_val || s1 != min_sidx)) ||
|
if( (min_val < 0 && (val1 != min_val || s1 != min_sidx)) ||
|
||||||
(max_val > 0 && (val2 != max_val || s2 != max_sidx)) )
|
(max_val > 0 && (val2 != max_val || s2 != max_sidx)) )
|
||||||
@ -1066,7 +1065,7 @@ protected:
|
|||||||
merge(src, dst);
|
merge(src, dst);
|
||||||
|
|
||||||
// check result
|
// check result
|
||||||
stringstream commonLog;
|
std::stringstream commonLog;
|
||||||
commonLog << "Depth " << depth << " :";
|
commonLog << "Depth " << depth << " :";
|
||||||
if(dst.depth() != depth)
|
if(dst.depth() != depth)
|
||||||
{
|
{
|
||||||
@ -1115,7 +1114,7 @@ protected:
|
|||||||
split(src, dst);
|
split(src, dst);
|
||||||
|
|
||||||
// check result
|
// check result
|
||||||
stringstream commonLog;
|
std::stringstream commonLog;
|
||||||
commonLog << "Depth " << depth << " :";
|
commonLog << "Depth " << depth << " :";
|
||||||
if(dst.size() != channels)
|
if(dst.size() != channels)
|
||||||
{
|
{
|
||||||
@ -1391,7 +1390,7 @@ TEST(Core_SVD, orthogonality)
|
|||||||
Mat mat_U, mat_W;
|
Mat mat_U, mat_W;
|
||||||
SVD::compute(mat_D, mat_W, mat_U, noArray(), SVD::FULL_UV);
|
SVD::compute(mat_D, mat_W, mat_U, noArray(), SVD::FULL_UV);
|
||||||
mat_U *= mat_U.t();
|
mat_U *= mat_U.t();
|
||||||
ASSERT_LT(norm(mat_U, Mat::eye(2, 2, type), NORM_INF), 1e-5);
|
ASSERT_LT(cvtest::norm(mat_U, Mat::eye(2, 2, type), NORM_INF), 1e-5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1713,7 +1712,7 @@ TEST(Mat_, range_based_for)
|
|||||||
|
|
||||||
Mat_<uchar> ref(3, 3);
|
Mat_<uchar> ref(3, 3);
|
||||||
ref.setTo(Scalar(1));
|
ref.setTo(Scalar(1));
|
||||||
ASSERT_DOUBLE_EQ(norm(img, ref), 0.);
|
ASSERT_DOUBLE_EQ(cvtest::norm(img, ref, NORM_INF), 0.);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(Mat, from_initializer_list)
|
TEST(Mat, from_initializer_list)
|
||||||
@ -1722,7 +1721,7 @@ TEST(Mat, from_initializer_list)
|
|||||||
Mat_<float> B(3, 1); B << 1, 2, 3;
|
Mat_<float> B(3, 1); B << 1, 2, 3;
|
||||||
|
|
||||||
ASSERT_EQ(A.type(), CV_32F);
|
ASSERT_EQ(A.type(), CV_32F);
|
||||||
ASSERT_DOUBLE_EQ(norm(A, B, NORM_INF), 0.);
|
ASSERT_DOUBLE_EQ(cvtest::norm(A, B, NORM_INF), 0.);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(Mat_, from_initializer_list)
|
TEST(Mat_, from_initializer_list)
|
||||||
@ -1730,7 +1729,7 @@ TEST(Mat_, from_initializer_list)
|
|||||||
Mat_<float> A = {1, 2, 3};
|
Mat_<float> A = {1, 2, 3};
|
||||||
Mat_<float> B(3, 1); B << 1, 2, 3;
|
Mat_<float> B(3, 1); B << 1, 2, 3;
|
||||||
|
|
||||||
ASSERT_DOUBLE_EQ(norm(A, B, NORM_INF), 0.);
|
ASSERT_DOUBLE_EQ(cvtest::norm(A, B, NORM_INF), 0.);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1754,3 +1753,5 @@ TEST(Mat_, template_based_ptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////////// tests for matrix operations and math functions ///////////////////////
|
/////////////////// tests for matrix operations and math functions ///////////////////////
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -7,8 +11,7 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "opencv2/core/softfloat.hpp"
|
#include "opencv2/core/softfloat.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
/// !!! NOTE !!! These tests happily avoid overflow cases & out-of-range arguments
|
/// !!! NOTE !!! These tests happily avoid overflow cases & out-of-range arguments
|
||||||
/// so that output arrays contain neigher Inf's nor Nan's.
|
/// so that output arrays contain neigher Inf's nor Nan's.
|
||||||
@ -3079,7 +3082,7 @@ TEST(Core_Cholesky, accuracy64f)
|
|||||||
for (int i = 0; i < A.rows; i++)
|
for (int i = 0; i < A.rows; i++)
|
||||||
for (int j = i + 1; j < A.cols; j++)
|
for (int j = i + 1; j < A.cols; j++)
|
||||||
A.at<double>(i, j) = 0.0;
|
A.at<double>(i, j) = 0.0;
|
||||||
EXPECT_LE(norm(refA, A*A.t(), CV_RELATIVE_L2), FLT_EPSILON);
|
EXPECT_LE(cvtest::norm(refA, A*A.t(), CV_RELATIVE_L2), FLT_EPSILON);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(Core_QR_Solver, accuracy64f)
|
TEST(Core_QR_Solver, accuracy64f)
|
||||||
@ -3099,7 +3102,7 @@ TEST(Core_QR_Solver, accuracy64f)
|
|||||||
|
|
||||||
//solve system with square matrix
|
//solve system with square matrix
|
||||||
solve(A, B, solutionQR, DECOMP_QR);
|
solve(A, B, solutionQR, DECOMP_QR);
|
||||||
EXPECT_LE(norm(A*solutionQR, B, CV_RELATIVE_L2), FLT_EPSILON);
|
EXPECT_LE(cvtest::norm(A*solutionQR, B, CV_RELATIVE_L2), FLT_EPSILON);
|
||||||
|
|
||||||
A = Mat(m, n, CV_64F);
|
A = Mat(m, n, CV_64F);
|
||||||
B = Mat(m, n, CV_64F);
|
B = Mat(m, n, CV_64F);
|
||||||
@ -3108,13 +3111,13 @@ TEST(Core_QR_Solver, accuracy64f)
|
|||||||
|
|
||||||
//solve normal system
|
//solve normal system
|
||||||
solve(A, B, solutionQR, DECOMP_QR | DECOMP_NORMAL);
|
solve(A, B, solutionQR, DECOMP_QR | DECOMP_NORMAL);
|
||||||
EXPECT_LE(norm(A.t()*(A*solutionQR), A.t()*B, CV_RELATIVE_L2), FLT_EPSILON);
|
EXPECT_LE(cvtest::norm(A.t()*(A*solutionQR), A.t()*B, CV_RELATIVE_L2), FLT_EPSILON);
|
||||||
|
|
||||||
//solve overdeterminated system as a least squares problem
|
//solve overdeterminated system as a least squares problem
|
||||||
Mat solutionSVD;
|
Mat solutionSVD;
|
||||||
solve(A, B, solutionQR, DECOMP_QR);
|
solve(A, B, solutionQR, DECOMP_QR);
|
||||||
solve(A, B, solutionSVD, DECOMP_SVD);
|
solve(A, B, solutionSVD, DECOMP_SVD);
|
||||||
EXPECT_LE(norm(solutionQR, solutionSVD, CV_RELATIVE_L2), FLT_EPSILON);
|
EXPECT_LE(cvtest::norm(solutionQR, solutionSVD, CV_RELATIVE_L2), FLT_EPSILON);
|
||||||
|
|
||||||
//solve system with singular matrix
|
//solve system with singular matrix
|
||||||
A = Mat(10, 10, CV_64F);
|
A = Mat(10, 10, CV_64F);
|
||||||
@ -3718,7 +3721,7 @@ TEST(Core_SoftFloat, sincos64)
|
|||||||
softdouble x = inputs[i];
|
softdouble x = inputs[i];
|
||||||
|
|
||||||
int xexp = x.getExp();
|
int xexp = x.getExp();
|
||||||
softdouble randEps = eps.setExp(max(xexp-52, -46));
|
softdouble randEps = eps.setExp(std::max(xexp-52, -46));
|
||||||
softdouble sx = sin(x);
|
softdouble sx = sin(x);
|
||||||
softdouble cx = cos(x);
|
softdouble cx = cos(x);
|
||||||
ASSERT_FALSE(sx.isInf()); ASSERT_FALSE(cx.isInf());
|
ASSERT_FALSE(sx.isInf()); ASSERT_FALSE(cx.isInf());
|
||||||
@ -3862,4 +3865,5 @@ TEST(Core_SoftFloat, CvRound)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
/* End of file. */
|
/* End of file. */
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
TEST(Core_OutputArrayCreate, _1997)
|
TEST(Core_OutputArrayCreate, _1997)
|
||||||
{
|
{
|
||||||
@ -154,3 +156,5 @@ TEST(Core_Copy, repeat_regression_8972)
|
|||||||
repeat(src, 5, 1, src);
|
repeat(src, 5, 1, src);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "opencv2/ts/ocl_test.hpp" // T-API like tests
|
#include "opencv2/ts/ocl_test.hpp" // T-API like tests
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
class CV_OperationsTest : public cvtest::BaseTest
|
class CV_OperationsTest : public cvtest::BaseTest
|
||||||
@ -134,16 +134,16 @@ bool CV_OperationsTest::TestMat()
|
|||||||
res = Mat(Mat(2 * rot_2x3) * res - shi_2x1) + shift;
|
res = Mat(Mat(2 * rot_2x3) * res - shi_2x1) + shift;
|
||||||
|
|
||||||
Mat tmp, res2;
|
Mat tmp, res2;
|
||||||
add(one_3x1, shi_3x1, tmp);
|
cv::add(one_3x1, shi_3x1, tmp);
|
||||||
add(tmp, shi_3x1, tmp);
|
cv::add(tmp, shi_3x1, tmp);
|
||||||
add(tmp, shi_3x1, tmp);
|
cv::add(tmp, shi_3x1, tmp);
|
||||||
gemm(rot_2x3, tmp, 2, shi_2x1, -1, res2, 0);
|
cv::gemm(rot_2x3, tmp, 2, shi_2x1, -1, res2, 0);
|
||||||
add(res2, Mat(2, 1, CV_32F, shift), res2);
|
cv::add(res2, Mat(2, 1, CV_32F, shift), res2);
|
||||||
|
|
||||||
CHECK_DIFF(res, res2);
|
CHECK_DIFF(res, res2);
|
||||||
|
|
||||||
Mat mat4x4(4, 4, CV_32F);
|
Mat mat4x4(4, 4, CV_32F);
|
||||||
randu(mat4x4, Scalar(0), Scalar(10));
|
cv::randu(mat4x4, Scalar(0), Scalar(10));
|
||||||
|
|
||||||
Mat roi1 = mat4x4(Rect(Point(1, 1), Size(2, 2)));
|
Mat roi1 = mat4x4(Rect(Point(1, 1), Size(2, 2)));
|
||||||
Mat roi2 = mat4x4(Range(1, 3), Range(1, 3));
|
Mat roi2 = mat4x4(Range(1, 3), Range(1, 3));
|
||||||
@ -508,19 +508,19 @@ bool CV_OperationsTest::TestTemplateMat()
|
|||||||
Mat_<float> resS = rot_2x3 * one_3x1;
|
Mat_<float> resS = rot_2x3 * one_3x1;
|
||||||
|
|
||||||
Mat_<float> tmp, res2, resS2;
|
Mat_<float> tmp, res2, resS2;
|
||||||
add(one_3x1, shi_3x1, tmp);
|
cv::add(one_3x1, shi_3x1, tmp);
|
||||||
add(tmp, shi_3x1, tmp);
|
cv::add(tmp, shi_3x1, tmp);
|
||||||
add(tmp, shi_3x1, tmp);
|
cv::add(tmp, shi_3x1, tmp);
|
||||||
gemm(rot_2x3, tmp, 2, shi_2x1, -1, res2, 0);
|
cv::gemm(rot_2x3, tmp, 2, shi_2x1, -1, res2, 0);
|
||||||
add(res2, Mat(2, 1, CV_32F, shift), res2);
|
cv::add(res2, Mat(2, 1, CV_32F, shift), res2);
|
||||||
|
|
||||||
gemm(rot_2x3, one_3x1, 1, shi_2x1, 0, resS2, 0);
|
cv::gemm(rot_2x3, one_3x1, 1, shi_2x1, 0, resS2, 0);
|
||||||
CHECK_DIFF(res, res2);
|
CHECK_DIFF(res, res2);
|
||||||
CHECK_DIFF(resS, resS2);
|
CHECK_DIFF(resS, resS2);
|
||||||
|
|
||||||
|
|
||||||
Mat_<float> mat4x4(4, 4);
|
Mat_<float> mat4x4(4, 4);
|
||||||
randu(mat4x4, Scalar(0), Scalar(10));
|
cv::randu(mat4x4, Scalar(0), Scalar(10));
|
||||||
|
|
||||||
Mat_<float> roi1 = mat4x4(Rect(Point(1, 1), Size(2, 2)));
|
Mat_<float> roi1 = mat4x4(Rect(Point(1, 1), Size(2, 2)));
|
||||||
Mat_<float> roi2 = mat4x4(Range(1, 3), Range(1, 3));
|
Mat_<float> roi2 = mat4x4(Range(1, 3), Range(1, 3));
|
||||||
@ -988,17 +988,17 @@ bool CV_OperationsTest::operations1()
|
|||||||
Mat A(1, 32, CV_32F), B;
|
Mat A(1, 32, CV_32F), B;
|
||||||
for( int i = 0; i < A.cols; i++ )
|
for( int i = 0; i < A.cols; i++ )
|
||||||
A.at<float>(i) = (float)(i <= 12 ? i : 24 - i);
|
A.at<float>(i) = (float)(i <= 12 ? i : 24 - i);
|
||||||
transpose(A, B);
|
cv::transpose(A, B);
|
||||||
|
|
||||||
int minidx[2] = {0, 0}, maxidx[2] = {0, 0};
|
int minidx[2] = {0, 0}, maxidx[2] = {0, 0};
|
||||||
double minval = 0, maxval = 0;
|
double minval = 0, maxval = 0;
|
||||||
minMaxIdx(A, &minval, &maxval, minidx, maxidx);
|
cv::minMaxIdx(A, &minval, &maxval, minidx, maxidx);
|
||||||
|
|
||||||
if( !(minidx[0] == 0 && minidx[1] == 31 && maxidx[0] == 0 && maxidx[1] == 12 &&
|
if( !(minidx[0] == 0 && minidx[1] == 31 && maxidx[0] == 0 && maxidx[1] == 12 &&
|
||||||
minval == -7 && maxval == 12))
|
minval == -7 && maxval == 12))
|
||||||
throw test_excep();
|
throw test_excep();
|
||||||
|
|
||||||
minMaxIdx(B, &minval, &maxval, minidx, maxidx);
|
cv::minMaxIdx(B, &minval, &maxval, minidx, maxidx);
|
||||||
|
|
||||||
if( !(minidx[0] == 31 && minidx[1] == 0 && maxidx[0] == 12 && maxidx[1] == 0 &&
|
if( !(minidx[0] == 31 && minidx[1] == 0 && maxidx[0] == 12 && maxidx[1] == 0 &&
|
||||||
minval == -7 && maxval == 12))
|
minval == -7 && maxval == 12))
|
||||||
@ -1006,13 +1006,13 @@ bool CV_OperationsTest::operations1()
|
|||||||
|
|
||||||
Matx33f b(1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f);
|
Matx33f b(1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, 8.f, 9.f);
|
||||||
Mat c;
|
Mat c;
|
||||||
add(Mat::zeros(3, 3, CV_32F), b, c);
|
cv::add(Mat::zeros(3, 3, CV_32F), b, c);
|
||||||
CV_Assert( cvtest::norm(b, c, CV_C) == 0 );
|
CV_Assert( cvtest::norm(b, c, CV_C) == 0 );
|
||||||
|
|
||||||
add(Mat::zeros(3, 3, CV_64F), b, c, noArray(), c.type());
|
cv::add(Mat::zeros(3, 3, CV_64F), b, c, noArray(), c.type());
|
||||||
CV_Assert( cvtest::norm(b, c, CV_C) == 0 );
|
CV_Assert( cvtest::norm(b, c, CV_C) == 0 );
|
||||||
|
|
||||||
add(Mat::zeros(6, 1, CV_64F), 1, c, noArray(), c.type());
|
cv::add(Mat::zeros(6, 1, CV_64F), 1, c, noArray(), c.type());
|
||||||
CV_Assert( cvtest::norm(Matx61f(1.f, 1.f, 1.f, 1.f, 1.f, 1.f), c, CV_C) == 0 );
|
CV_Assert( cvtest::norm(Matx61f(1.f, 1.f, 1.f, 1.f, 1.f, 1.f), c, CV_C) == 0 );
|
||||||
|
|
||||||
vector<Point2f> pt2d(3);
|
vector<Point2f> pt2d(3);
|
||||||
@ -1025,7 +1025,7 @@ bool CV_OperationsTest::operations1()
|
|||||||
0.9058f, 0.0975f, 0.9649f, 0.4854f,
|
0.9058f, 0.0975f, 0.9649f, 0.4854f,
|
||||||
0.1270f, 0.2785f, 0.1576f, 0.8003f,
|
0.1270f, 0.2785f, 0.1576f, 0.8003f,
|
||||||
0.9134f, 0.5469f, 0.9706f, 0.1419f);
|
0.9134f, 0.5469f, 0.9706f, 0.1419f);
|
||||||
double d = determinant(m44);
|
double d = cv::determinant(m44);
|
||||||
CV_Assert( fabs(d - (-0.0262)) <= 0.001 );
|
CV_Assert( fabs(d - (-0.0262)) <= 0.001 );
|
||||||
|
|
||||||
Cv32suf z;
|
Cv32suf z;
|
||||||
|
@ -1,15 +1,9 @@
|
|||||||
#ifdef __GNUC__
|
// This file is part of OpenCV project.
|
||||||
# pragma GCC diagnostic ignored "-Wmissing-declarations"
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
# if defined __clang__ || defined __APPLE__
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
# pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
|
||||||
# pragma GCC diagnostic ignored "-Wextra"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __OPENCV_TEST_PRECOMP_HPP__
|
#ifndef __OPENCV_TEST_PRECOMP_HPP__
|
||||||
#define __OPENCV_TEST_PRECOMP_HPP__
|
#define __OPENCV_TEST_PRECOMP_HPP__
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include "opencv2/ts.hpp"
|
#include "opencv2/ts.hpp"
|
||||||
#include "opencv2/ts/ocl_test.hpp"
|
#include "opencv2/ts/ocl_test.hpp"
|
||||||
#include "opencv2/core/core_c.h"
|
#include "opencv2/core/core_c.h"
|
||||||
|
@ -41,6 +41,8 @@
|
|||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
#ifdef GTEST_CAN_COMPARE_NULL
|
#ifdef GTEST_CAN_COMPARE_NULL
|
||||||
# define EXPECT_NULL(ptr) EXPECT_EQ(NULL, ptr)
|
# define EXPECT_NULL(ptr) EXPECT_EQ(NULL, ptr)
|
||||||
#else
|
#else
|
||||||
@ -366,6 +368,8 @@ TEST(Core_Ptr, make)
|
|||||||
EXPECT_TRUE(deleted);
|
EXPECT_TRUE(deleted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
struct SpeciallyDeletable
|
struct SpeciallyDeletable
|
||||||
@ -385,6 +389,8 @@ void DefaultDeleter<SpeciallyDeletable>::operator()(SpeciallyDeletable * obj) co
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace opencv_test { namespace {
|
||||||
|
|
||||||
TEST(Core_Ptr, specialized_deleter)
|
TEST(Core_Ptr, specialized_deleter)
|
||||||
{
|
{
|
||||||
SpeciallyDeletable sd;
|
SpeciallyDeletable sd;
|
||||||
@ -393,3 +399,5 @@ TEST(Core_Ptr, specialized_deleter)
|
|||||||
|
|
||||||
ASSERT_TRUE(sd.deleted);
|
ASSERT_TRUE(sd.deleted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
|
// This file is part of OpenCV project.
|
||||||
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||||
|
// of this distribution and at http://opencv.org/license.html.
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Core_RandTest : public cvtest::BaseTest
|
class Core_RandTest : public cvtest::BaseTest
|
||||||
{
|
{
|
||||||
@ -383,7 +385,6 @@ TEST(Core_Rand, Regression_Stack_Corruption)
|
|||||||
ASSERT_EQ(param2, 2);
|
ASSERT_EQ(param2, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
class RandRowFillParallelLoopBody : public cv::ParallelLoopBody
|
class RandRowFillParallelLoopBody : public cv::ParallelLoopBody
|
||||||
{
|
{
|
||||||
@ -417,4 +418,4 @@ TEST(Core_Rand, parallel_for_stable_results)
|
|||||||
ASSERT_EQ(0, countNonZero(dst1 != dst2));
|
ASSERT_EQ(0, countNonZero(dst1 != dst2));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
}} // namespace
|
||||||
|
@ -41,8 +41,7 @@
|
|||||||
|
|
||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
|
|
||||||
using namespace cv;
|
namespace opencv_test { namespace {
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
class Core_RotatedRectConstructorTest : public cvtest::BaseTest
|
class Core_RotatedRectConstructorTest : public cvtest::BaseTest
|
||||||
{
|
{
|
||||||
@ -72,7 +71,7 @@ int Core_RotatedRectConstructorTest::prepare_test_case( int test_case_idx )
|
|||||||
{
|
{
|
||||||
b = Point2f( rng.uniform(-MAX_COORD_VAL, MAX_COORD_VAL), rng.uniform(-MAX_COORD_VAL, MAX_COORD_VAL) );
|
b = Point2f( rng.uniform(-MAX_COORD_VAL, MAX_COORD_VAL), rng.uniform(-MAX_COORD_VAL, MAX_COORD_VAL) );
|
||||||
}
|
}
|
||||||
while( norm(a - b) <= FLT_EPSILON );
|
while( cv::norm(a - b) <= FLT_EPSILON );
|
||||||
Vec2f along(a - b);
|
Vec2f along(a - b);
|
||||||
Vec2f perp = Vec2f(-along[1], along[0]);
|
Vec2f perp = Vec2f(-along[1], along[0]);
|
||||||
double d = (double) rng.uniform(1.0f, 5.0f);
|
double d = (double) rng.uniform(1.0f, 5.0f);
|
||||||
@ -93,9 +92,9 @@ int Core_RotatedRectConstructorTest::validate_test_results( int )
|
|||||||
int count_match = 0;
|
int count_match = 0;
|
||||||
for( int i = 0; i < 4; i++ )
|
for( int i = 0; i < 4; i++ )
|
||||||
{
|
{
|
||||||
if( norm(vertices[i] - a) <= 0.001 ) count_match++;
|
if( cv::norm(vertices[i] - a) <= 0.001 ) count_match++;
|
||||||
else if( norm(vertices[i] - b) <= 0.001 ) count_match++;
|
else if( cv::norm(vertices[i] - b) <= 0.001 ) count_match++;
|
||||||
else if( norm(vertices[i] - c) <= 0.001 ) count_match++;
|
else if( cv::norm(vertices[i] - c) <= 0.001 ) count_match++;
|
||||||
}
|
}
|
||||||
if( count_match == 3 )
|
if( count_match == 3 )
|
||||||
return cvtest::TS::OK;
|
return cvtest::TS::OK;
|
||||||
@ -105,3 +104,5 @@ int Core_RotatedRectConstructorTest::validate_test_results( int )
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST(Core_RotatedRect, three_point_constructor) { Core_RotatedRectConstructorTest test; test.safe_run(); }
|
TEST(Core_RotatedRect, three_point_constructor) { Core_RotatedRectConstructorTest test; test.safe_run(); }
|
||||||
|
|
||||||
|
}} // namespace
|
||||||
|
@ -42,11 +42,11 @@
|
|||||||
#include "test_precomp.hpp"
|
#include "test_precomp.hpp"
|
||||||
#include "opencv2/ts/ocl_test.hpp"
|
#include "opencv2/ts/ocl_test.hpp"
|
||||||
|
|
||||||
using namespace cvtest;
|
using namespace opencv_test;
|
||||||
using namespace testing;
|
using namespace testing;
|
||||||
using namespace cv;
|
using namespace cv;
|
||||||
|
|
||||||
namespace cvtest {
|
namespace opencv_test {
|
||||||
namespace ocl {
|
namespace ocl {
|
||||||
|
|
||||||
#define UMAT_TEST_SIZES testing::Values(cv::Size(1, 1), cv::Size(1,128), cv::Size(128, 1), \
|
#define UMAT_TEST_SIZES testing::Values(cv::Size(1, 1), cv::Size(1,128), cv::Size(128, 1), \
|
||||||
@ -1073,7 +1073,7 @@ TEST(UMat, async_unmap)
|
|||||||
Mat m = Mat(1000, 1000, CV_8UC1, Scalar::all(0));
|
Mat m = Mat(1000, 1000, CV_8UC1, Scalar::all(0));
|
||||||
UMat u = m.getUMat(ACCESS_READ);
|
UMat u = m.getUMat(ACCESS_READ);
|
||||||
UMat dst;
|
UMat dst;
|
||||||
add(u, Scalar::all(0), dst); // start async operation
|
cv::add(u, Scalar::all(0), dst); // start async operation
|
||||||
u.release();
|
u.release();
|
||||||
m.release();
|
m.release();
|
||||||
}
|
}
|
||||||
@ -1233,7 +1233,7 @@ TEST(UMat, DISABLED_Test_same_behaviour_read_and_read)
|
|||||||
UMat u(Size(10, 10), CV_8UC1, Scalar::all(0));
|
UMat u(Size(10, 10), CV_8UC1, Scalar::all(0));
|
||||||
Mat m = u.getMat(ACCESS_READ);
|
Mat m = u.getMat(ACCESS_READ);
|
||||||
UMat dst;
|
UMat dst;
|
||||||
add(u, Scalar::all(1), dst);
|
cv::add(u, Scalar::all(1), dst);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@ -1250,7 +1250,7 @@ TEST(UMat, DISABLED_Test_same_behaviour_read_and_write)
|
|||||||
{
|
{
|
||||||
UMat u(Size(10, 10), CV_8UC1, Scalar::all(0));
|
UMat u(Size(10, 10), CV_8UC1, Scalar::all(0));
|
||||||
Mat m = u.getMat(ACCESS_READ);
|
Mat m = u.getMat(ACCESS_READ);
|
||||||
add(u, Scalar::all(1), u);
|
cv::add(u, Scalar::all(1), u);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@ -1267,7 +1267,7 @@ TEST(UMat, DISABLED_Test_same_behaviour_write_and_read)
|
|||||||
UMat u(Size(10, 10), CV_8UC1, Scalar::all(0));
|
UMat u(Size(10, 10), CV_8UC1, Scalar::all(0));
|
||||||
Mat m = u.getMat(ACCESS_WRITE);
|
Mat m = u.getMat(ACCESS_WRITE);
|
||||||
UMat dst;
|
UMat dst;
|
||||||
add(u, Scalar::all(1), dst);
|
cv::add(u, Scalar::all(1), dst);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@ -1283,7 +1283,7 @@ TEST(UMat, DISABLED_Test_same_behaviour_write_and_write)
|
|||||||
{
|
{
|
||||||
UMat u(Size(10, 10), CV_8UC1, Scalar::all(0));
|
UMat u(Size(10, 10), CV_8UC1, Scalar::all(0));
|
||||||
Mat m = u.getMat(ACCESS_WRITE);
|
Mat m = u.getMat(ACCESS_WRITE);
|
||||||
add(u, Scalar::all(1), u);
|
cv::add(u, Scalar::all(1), u);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@ -1301,7 +1301,7 @@ TEST(UMat, mat_umat_sync)
|
|||||||
}
|
}
|
||||||
|
|
||||||
UMat uDiff;
|
UMat uDiff;
|
||||||
compare(u, 255, uDiff, CMP_NE);
|
cv::compare(u, 255, uDiff, CMP_NE);
|
||||||
ASSERT_EQ(0, countNonZero(uDiff));
|
ASSERT_EQ(0, countNonZero(uDiff));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1314,7 +1314,7 @@ TEST(UMat, testTempObjects_UMat)
|
|||||||
}
|
}
|
||||||
|
|
||||||
UMat uDiff;
|
UMat uDiff;
|
||||||
compare(u, 255, uDiff, CMP_NE);
|
cv::compare(u, 255, uDiff, CMP_NE);
|
||||||
ASSERT_EQ(0, countNonZero(uDiff));
|
ASSERT_EQ(0, countNonZero(uDiff));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1383,4 +1383,4 @@ TEST(UMat, testTempObjects_Mat_issue_8693)
|
|||||||
EXPECT_EQ(0, cvtest::norm(srcUMat.getMat(ACCESS_READ), srcMat, NORM_INF));
|
EXPECT_EQ(0, cvtest::norm(srcUMat.getMat(ACCESS_READ), srcMat, NORM_INF));
|
||||||
}
|
}
|
||||||
|
|
||||||
} } // namespace cvtest::ocl
|
} } // namespace opencv_test::ocl
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user