cv::norm -> cvtest::norm in tests

Conflicts:

	modules/core/src/stat.cpp
This commit is contained in:
Ilya Lavrenov
2014-04-08 01:11:58 +04:00
parent a6ef45aa13
commit aa5326c231
37 changed files with 158 additions and 142 deletions

View File

@@ -225,12 +225,12 @@ Mat TestUtils::readImageType(const String &fname, int type)
double TestUtils::checkNorm1(InputArray m, InputArray mask)
{
return norm(m.getMat(), NORM_INF, mask);
return cvtest::norm(m.getMat(), NORM_INF, mask.getMat());
}
double TestUtils::checkNorm2(InputArray m1, InputArray m2, InputArray mask)
{
return norm(m1.getMat(), m2.getMat(), NORM_INF, mask);
return cvtest::norm(m1.getMat(), m2.getMat(), NORM_INF, mask.getMat());
}
double TestUtils::checkSimilarity(InputArray m1, InputArray m2)

View File

@@ -1238,15 +1238,16 @@ norm_(const _Tp* src1, const _Tp* src2, size_t total, int cn, int normType, doub
}
double norm(const Mat& src, int normType, const Mat& mask)
double norm(InputArray _src, int normType, InputArray _mask)
{
Mat src = _src.getMat(), mask = _mask.getMat();
if( normType == NORM_HAMMING || normType == NORM_HAMMING2 )
{
if( !mask.empty() )
{
Mat temp;
bitwise_and(src, mask, temp);
return norm(temp, normType, Mat());
return cvtest::norm(temp, normType, Mat());
}
CV_Assert( src.depth() == CV_8U );
@@ -1317,8 +1318,12 @@ double norm(const Mat& src, int normType, const Mat& mask)
}
double norm(const Mat& src1, const Mat& src2, int normType, const Mat& mask)
double norm(InputArray _src1, InputArray _src2, int normType, InputArray _mask)
{
Mat src1 = _src1.getMat(), src2 = _src2.getMat(), mask = _mask.getMat();
bool isRelative = (normType & NORM_RELATIVE) != 0;
normType &= ~NORM_RELATIVE;
if( normType == NORM_HAMMING || normType == NORM_HAMMING2 )
{
Mat temp;
@@ -1391,7 +1396,7 @@ double norm(const Mat& src1, const Mat& src2, int normType, const Mat& mask)
}
if( normType0 == NORM_L2 )
result = sqrt(result);
return result;
return isRelative ? result / (cvtest::norm(src2, normType) + DBL_EPSILON) : result;
}