Skip to content

Commit 5707304

Browse files
committed
Merge pull request opencv#9633 from saskatchewancatch:psnr-doc
2 parents cb0d695 + a90a93b commit 5707304

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

modules/core/include/opencv2/core.hpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,10 +697,21 @@ CV_EXPORTS_W double norm(InputArray src1, InputArray src2,
697697
*/
698698
CV_EXPORTS double norm( const SparseMat& src, int normType );
699699

700-
/** @brief computes PSNR image/video quality metric
700+
/** @brief Computes the Peak Signal-to-Noise Ratio (PSNR) image quality metric.
701+
702+
This function calculates the Peak Signal-to-Noise Ratio (PSNR) image quality metric in decibels (dB), between two input arrays src1 and src2. Arrays must have depth CV_8U.
703+
704+
The PSNR is calculated as follows:
705+
706+
\f[
707+
\texttt{PSNR} = 10 \cdot \log_{10}{\left( \frac{R^2}{MSE} \right) }
708+
\f]
709+
710+
where R is the maximum integer value of depth CV_8U (255) and MSE is the mean squared error between the two arrays.
711+
712+
@param src1 first input array.
713+
@param src2 second input array of the same size as src1.
701714
702-
see http://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio for details
703-
@todo document
704715
*/
705716
CV_EXPORTS_W double PSNR(InputArray src1, InputArray src2);
706717

0 commit comments

Comments
 (0)