Skip to content

Commit a90a93b

Browse files
i9629 - Added actual documentation for cv::PSNR function
1 parent 1caca21 commit a90a93b

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
@@ -690,10 +690,21 @@ CV_EXPORTS_W double norm(InputArray src1, InputArray src2,
690690
*/
691691
CV_EXPORTS double norm( const SparseMat& src, int normType );
692692

693-
/** @brief computes PSNR image/video quality metric
693+
/** @brief Computes the Peak Signal-to-Noise Ratio (PSNR) image quality metric.
694+
695+
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.
696+
697+
The PSNR is calculated as follows:
698+
699+
\f[
700+
\texttt{PSNR} = 10 \cdot \log_{10}{\left( \frac{R^2}{MSE} \right) }
701+
\f]
702+
703+
where R is the maximum integer value of depth CV_8U (255) and MSE is the mean squared error between the two arrays.
704+
705+
@param src1 first input array.
706+
@param src2 second input array of the same size as src1.
694707
695-
see http://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio for details
696-
@todo document
697708
*/
698709
CV_EXPORTS_W double PSNR(InputArray src1, InputArray src2);
699710

0 commit comments

Comments
 (0)