mirror of
https://github.com/opencv/opencv.git
synced 2025-06-12 04:12:52 +08:00
Merge pull request #9642 from saskatchewancatch:psnr-checks
This commit is contained in:
commit
73298ea875
@ -4150,7 +4150,9 @@ double cv::PSNR(InputArray _src1, InputArray _src2)
|
||||
{
|
||||
CV_INSTRUMENT_REGION()
|
||||
|
||||
CV_Assert( _src1.depth() == CV_8U );
|
||||
//Input arrays must have depth CV_8U
|
||||
CV_Assert( _src1.depth() == CV_8U && _src2.depth() == CV_8U );
|
||||
|
||||
double diff = std::sqrt(norm(_src1, _src2, NORM_L2SQR)/(_src1.total()*_src1.channels()));
|
||||
return 20*log10(255./(diff+DBL_EPSILON));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user