We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 37ba1d6 + 0e44ad5 commit 73298eaCopy full SHA for 73298ea
modules/core/src/stat.cpp
@@ -4150,7 +4150,9 @@ double cv::PSNR(InputArray _src1, InputArray _src2)
4150
{
4151
CV_INSTRUMENT_REGION()
4152
4153
- CV_Assert( _src1.depth() == CV_8U );
+ //Input arrays must have depth CV_8U
4154
+ CV_Assert( _src1.depth() == CV_8U && _src2.depth() == CV_8U );
4155
+
4156
double diff = std::sqrt(norm(_src1, _src2, NORM_L2SQR)/(_src1.total()*_src1.channels()));
4157
return 20*log10(255./(diff+DBL_EPSILON));
4158
}
0 commit comments