disabled 'reshape', 'copyTo' test

This commit is contained in:
Ilya Lavrenov
2014-02-15 16:29:40 +04:00
parent 7ce2c3574a
commit 9b627a5e9f
5 changed files with 42 additions and 123 deletions

View File

@@ -45,8 +45,6 @@
#include "ocl_test.hpp"
#include "ts_perf.hpp"
#ifdef HAVE_OPENCL
namespace cvtest {
namespace ocl {
@@ -128,6 +126,4 @@ using namespace perf;
} // namespace cvtest::ocl
} // namespace cvtest
#endif // HAVE_OPENCL
#endif // __OPENCV_TS_OCL_PERF_HPP__

View File

@@ -42,11 +42,8 @@
#ifndef __OPENCV_TS_OCL_TEST_HPP__
#define __OPENCV_TS_OCL_TEST_HPP__
#include "cvconfig.h" // to get definition of HAVE_OPENCL
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCL
#include "opencv2/ts.hpp"
#include "opencv2/highgui.hpp"
@@ -60,38 +57,6 @@ namespace ocl {
using namespace cv;
using namespace testing;
namespace traits {
template <typename T>
struct GetMatForRead
{
};
template <>
struct GetMatForRead<Mat>
{
static const Mat get(const Mat& m) { return m; }
};
template <>
struct GetMatForRead<UMat>
{
static const Mat get(const UMat& m) { return m.getMat(ACCESS_READ); }
};
template <>
struct GetMatForRead<MatExpr>
{
static const Mat get(const MatExpr& m) { return m; }
};
} // namespace traits
template <typename T>
const Mat getMatForRead(const T& mat)
{
return traits::GetMatForRead<T>::get(mat);
}
extern int test_loop_times;
#define MAX_VALUE 357
@@ -234,54 +199,22 @@ struct CV_EXPORTS TestUtils
// If the two vectors are not equal, it will return the difference in vector size
// Else it will return (total diff of each 1 and 2 rects covered pixels)/(total 1 rects covered pixels)
// The smaller, the better matched
static double checkRectSimilarity(cv::Size sz, std::vector<cv::Rect>& ob1, std::vector<cv::Rect>& ob2);
static double checkRectSimilarity(const cv::Size & sz, std::vector<cv::Rect>& ob1, std::vector<cv::Rect>& ob2);
//! read image from testdata folder.
static cv::Mat readImage(const String &fileName, int flags = cv::IMREAD_COLOR);
static cv::Mat readImageType(const String &fname, int type);
static double checkNorm(const cv::Mat &m);
static double checkNorm(const cv::Mat &m1, const cv::Mat &m2);
static double checkSimilarity(const cv::Mat &m1, const cv::Mat &m2);
static inline double checkNormRelative(const Mat &m1, const Mat &m2)
static double checkNorm(InputArray m);
static double checkNorm(InputArray m1, InputArray m2);
static double checkSimilarity(InputArray m1, InputArray m2);
static void showDiff(InputArray _src, InputArray _gold, InputArray _actual, double eps, bool alwaysShow);
static inline double checkNormRelative(InputArray m1, InputArray m2)
{
return cv::norm(m1, m2, cv::NORM_INF) /
return cv::norm(m1.getMat(), m2.getMat(), cv::NORM_INF) /
std::max((double)std::numeric_limits<float>::epsilon(),
(double)std::max(cv::norm(m1, cv::NORM_INF), norm(m2, cv::NORM_INF)));
}
static void showDiff(const Mat& src, const Mat& gold, const Mat& actual, double eps, bool alwaysShow = false);
template <typename T1>
static double checkNorm(const T1& m)
{
return checkNorm(getMatForRead(m));
}
template <typename T1, typename T2>
static double checkNorm(const T1& m1, const T2& m2)
{
return checkNorm(getMatForRead(m1), getMatForRead(m2));
}
template <typename T1, typename T2>
static double checkSimilarity(const T1& m1, const T2& m2)
{
return checkSimilarity(getMatForRead(m1), getMatForRead(m2));
}
template <typename T1, typename T2>
static inline double checkNormRelative(const T1& m1, const T2& m2)
{
const Mat _m1 = getMatForRead(m1);
const Mat _m2 = getMatForRead(m2);
return checkNormRelative(_m1, _m2);
}
template <typename T1, typename T2, typename T3>
static void showDiff(const T1& src, const T2& gold, const T3& actual, double eps, bool alwaysShow = false)
{
const Mat _src = getMatForRead(src);
const Mat _gold = getMatForRead(gold);
const Mat _actual = getMatForRead(actual);
showDiff(_src, _gold, _actual, eps, alwaysShow);
(double)std::max(cv::norm(m1.getMat(), cv::NORM_INF), norm(m2.getMat(), cv::NORM_INF)));
}
};
@@ -341,8 +274,6 @@ CV_ENUM(BorderType, BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT, BORDER_WR
#define OCL_INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
INSTANTIATE_TEST_CASE_P(OCL_ ## prefix, test_case_name, generator)
}} // namespace cvtest::ocl
#endif // HAVE_OPENCL
} } // namespace cvtest::ocl
#endif // __OPENCV_TS_OCL_TEST_HPP__