Skip to content

Commit 73298ea

Browse files
committed
Merge pull request opencv#9642 from saskatchewancatch:psnr-checks
2 parents 37ba1d6 + 0e44ad5 commit 73298ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

modules/core/src/stat.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4150,7 +4150,9 @@ double cv::PSNR(InputArray _src1, InputArray _src2)
41504150
{
41514151
CV_INSTRUMENT_REGION()
41524152

4153-
CV_Assert( _src1.depth() == CV_8U );
4153+
//Input arrays must have depth CV_8U
4154+
CV_Assert( _src1.depth() == CV_8U && _src2.depth() == CV_8U );
4155+
41544156
double diff = std::sqrt(norm(_src1, _src2, NORM_L2SQR)/(_src1.total()*_src1.channels()));
41554157
return 20*log10(255./(diff+DBL_EPSILON));
41564158
}

0 commit comments

Comments
 (0)