ts: refactor OpenCV tests

- removed tr1 usage (dropped in C++17)
- moved includes of vector/map/iostream/limits into ts.hpp
- require opencv_test + anonymous namespace (added compile check)
- fixed norm() usage (must be from cvtest::norm for checks) and other conflict functions
- added missing license headers
This commit is contained in:
Alexander Alekhin
2017-11-05 13:48:40 +00:00
parent f1e50ecab3
commit 4a297a2443
435 changed files with 2009 additions and 2378 deletions

View File

@@ -5,12 +5,8 @@
#ifndef __OPENCV_TEST_INVARIANCE_UTILS_HPP__
#define __OPENCV_TEST_INVARIANCE_UTILS_HPP__
#include "test_precomp.hpp"
namespace opencv_test { namespace {
using namespace std;
using namespace cv;
static
Mat generateHomography(float angle)
{
// angle - rotation around Oz in degrees
@@ -23,7 +19,6 @@ Mat generateHomography(float angle)
return H;
}
static
Mat rotateImage(const Mat& srcImage, const Mat& srcMask, float angle, Mat& dstImage, Mat& dstMask)
{
// angle - rotation around Oz in degrees
@@ -43,10 +38,9 @@ Mat rotateImage(const Mat& srcImage, const Mat& srcMask, float angle, Mat& dstIm
return H;
}
static
float calcCirclesIntersectArea(const Point2f& p0, float r0, const Point2f& p1, float r1)
{
float c = static_cast<float>(norm(p0 - p1)), sqr_c = c * c;
float c = static_cast<float>(cv::norm(p0 - p1)), sqr_c = c * c;
float sqr_r0 = r0 * r0;
float sqr_r1 = r1 * r1;
@@ -69,7 +63,6 @@ float calcCirclesIntersectArea(const Point2f& p0, float r0, const Point2f& p1, f
0.5f * sqr_r1 * (A1 - sin(A1));
}
static
float calcIntersectRatio(const Point2f& p0, float r0, const Point2f& p1, float r1)
{
float intersectArea = calcCirclesIntersectArea(p0, r0, p1, r1);
@@ -77,7 +70,6 @@ float calcIntersectRatio(const Point2f& p0, float r0, const Point2f& p1, float r
return intersectArea / unionArea;
}
static
void scaleKeyPoints(const vector<KeyPoint>& src, vector<KeyPoint>& dst, float scale)
{
dst.resize(src.size());
@@ -89,4 +81,5 @@ void scaleKeyPoints(const vector<KeyPoint>& src, vector<KeyPoint>& dst, float sc
}
}
}} // namespace
#endif // __OPENCV_TEST_INVARIANCE_UTILS_HPP__