From a90a93b454a24cc97c85af4b25fbf1d1dfd87899 Mon Sep 17 00:00:00 2001 From: saskatchewancatch Date: Thu, 14 Sep 2017 18:20:00 -0600 Subject: [PATCH] i9629 - Added actual documentation for cv::PSNR function --- modules/core/include/opencv2/core.hpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/core/include/opencv2/core.hpp b/modules/core/include/opencv2/core.hpp index b077d06dcd..222db64951 100644 --- a/modules/core/include/opencv2/core.hpp +++ b/modules/core/include/opencv2/core.hpp @@ -690,10 +690,21 @@ CV_EXPORTS_W double norm(InputArray src1, InputArray src2, */ CV_EXPORTS double norm( const SparseMat& src, int normType ); -/** @brief computes PSNR image/video quality metric +/** @brief Computes the Peak Signal-to-Noise Ratio (PSNR) image quality metric. + +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. + +The PSNR is calculated as follows: + +\f[ +\texttt{PSNR} = 10 \cdot \log_{10}{\left( \frac{R^2}{MSE} \right) } +\f] + +where R is the maximum integer value of depth CV_8U (255) and MSE is the mean squared error between the two arrays. + +@param src1 first input array. +@param src2 second input array of the same size as src1. -see http://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio for details -@todo document */ CV_EXPORTS_W double PSNR(InputArray src1, InputArray src2);