Skip to content

Commit 4852f01

Browse files
author
Steven Puttemans
committed
backport of PR 9367
1 parent b398b57 commit 4852f01

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/tutorials/highgui/video-input-psnr-ssim/video-input-psnr-ssim.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Then the PSNR is expressed as:
111111
112112
PSNR = 10 \cdot \log_{10} \left( \frac{MAX_I^2}{MSE} \right)
113113
114-
Here the :math:`MAX_I^2` is the maximum valid value for a pixel. In case of the simple single byte image per pixel per channel this is 255. When two images are the same the MSE will give zero, resulting in an invalid divide by zero operation in the PSNR formula. In this case the PSNR is undefined and as we'll need to handle this case separately. The transition to a logarithmic scale is made because the pixel values have a very wide dynamic range. All this translated to OpenCV and a C++ function looks like:
114+
Here the :math:`MAX_I` is the maximum valid value for a pixel. In case of the simple single byte image per pixel per channel this is 255. When two images are the same the MSE will give zero, resulting in an invalid divide by zero operation in the PSNR formula. In this case the PSNR is undefined and as we'll need to handle this case separately. The transition to a logarithmic scale is made because the pixel values have a very wide dynamic range. All this translated to OpenCV and a C++ function looks like:
115115

116116
.. code-block:: cpp
117117

0 commit comments

Comments
 (0)