mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
cv2cvtest part2
This commit is contained in:
@@ -129,6 +129,7 @@ CV_EXPORTS void minMaxLoc(const Mat& src, double* minval, double* maxval,
|
||||
CV_EXPORTS double norm(InputArray src, int normType, InputArray mask=noArray());
|
||||
CV_EXPORTS double norm(InputArray src1, InputArray src2, int normType, InputArray mask=noArray());
|
||||
CV_EXPORTS Scalar mean(const Mat& src, const Mat& mask=Mat());
|
||||
CV_EXPORTS double PSNR(InputArray src1, InputArray src2);
|
||||
|
||||
CV_EXPORTS bool cmpUlps(const Mat& data, const Mat& refdata, int expMaxDiff, double* realMaxDiff, vector<int>* idx);
|
||||
|
||||
|
||||
@@ -1399,6 +1399,12 @@ double norm(InputArray _src1, InputArray _src2, int normType, InputArray _mask)
|
||||
return isRelative ? result / (cvtest::norm(src2, normType) + DBL_EPSILON) : result;
|
||||
}
|
||||
|
||||
double PSNR(InputArray _src1, InputArray _src2)
|
||||
{
|
||||
CV_Assert( _src1.depth() == CV_8U );
|
||||
double diff = std::sqrt(cvtest::norm(_src1, _src2, NORM_L2SQR)/(_src1.total()*_src1.channels()));
|
||||
return 20*log10(255./(diff+DBL_EPSILON));
|
||||
}
|
||||
|
||||
template<typename _Tp> static double
|
||||
crossCorr_(const _Tp* src1, const _Tp* src2, size_t total)
|
||||
|
||||
Reference in New Issue
Block a user