5#ifndef OPENCV_QUALITY_QUALITYPSNR_HPP
6#define OPENCV_QUALITY_QUALITYPSNR_HPP
9#include "qualitybase.hpp"
10#include "qualitymse.hpp"
26#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900)
27 static constexpr double MAX_PIXEL_VALUE_DEFAULT = 255.;
30 static const int MAX_PIXEL_VALUE_DEFAULT = 255;
50 auto result = _qualityMSE->compute( cmp );
51 _qualityMSE->getQualityMap(_qualityMap);
81 CV_WRAP
double getMaxPixelValue()
const {
return _maxPixelValue; }
87 CV_WRAP
void setMaxPixelValue(
double val) { this->_maxPixelValue = val; }
96 : _qualityMSE(std::move(qualityMSE))
97 , _maxPixelValue(maxPixelValue)
101 static double _mse_to_psnr(
double mse,
double max_pixel_value)
104 ? std::numeric_limits<double>::infinity()
105 : 10. * std::log10((max_pixel_value * max_pixel_value) / mse)
112 for (
int i = 0; i < mse.rows; ++i)
113 mse(i) = _mse_to_psnr(mse(i), max_pixel_value);
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:295
Definition: qualitybase.hpp:25
CV_WRAP void clear() CV_OVERRIDE
Implements Algorithm::clear()
Definition: qualitybase.hpp:46
CV_WRAP bool empty() const CV_OVERRIDE
Implements Algorithm::empty()
Definition: qualitybase.hpp:49
CV_WRAP cv::Scalar compute(InputArrayOfArrays cmpImgs) CV_OVERRIDE
Computes MSE for reference images supplied in class constructor and provided comparison images
static CV_WRAP Ptr< QualityMSE > create(InputArray ref)
Create an object which calculates quality
Full reference peak signal to noise ratio (PSNR) algorithm https://en.wikipedia.org/wiki/Peak_signal-...
Definition: qualitypsnr.hpp:21
static const int MAX_PIXEL_VALUE_DEFAULT
Default maximum pixel value
Definition: qualitypsnr.hpp:30
QualityPSNR(Ptr< QualityMSE > qualityMSE, double maxPixelValue)
Constructor
Definition: qualitypsnr.hpp:95
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74