OpenCV  4.1.0
Open Source Computer Vision
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
cv::quality::QualityPSNR Class Reference

Full reference peak signal to noise ratio (PSNR) algorithm https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio. More...

#include <opencv2/quality/qualitypsnr.hpp>

Inheritance diagram for cv::quality::QualityPSNR:
cv::quality::QualityBase cv::Algorithm

Public Member Functions

void clear () CV_OVERRIDE
 Implements Algorithm::clear()
 
cv::Scalar compute (InputArrayOfArrays cmpImgs) CV_OVERRIDE
 compute the PSNR
 
bool empty () const CV_OVERRIDE
 Implements Algorithm::empty()
 
double getMaxPixelValue () const
 return the maximum pixel value used for PSNR computation
 
void setMaxPixelValue (double val)
 sets the maximum pixel value used for PSNR computation
 
- Public Member Functions inherited from cv::quality::QualityBase
virtual ~QualityBase ()=default
 Destructor.
 
virtual void getQualityMaps (OutputArrayOfArrays dst) const
 Returns output quality map images that were generated during computation, if supported by the algorithm.
 
- Public Member Functions inherited from cv::Algorithm
 Algorithm ()
 
virtual ~Algorithm ()
 
virtual String getDefaultName () const
 
virtual void read (const FileNode &fn)
 Reads algorithm parameters from a file storage.
 
virtual void save (const String &filename) const
 
virtual void write (FileStorage &fs) const
 Stores algorithm parameters in a file storage.
 
void write (const Ptr< FileStorage > &fs, const String &name=String()) const
 simplified API for language bindingsThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Static Public Member Functions

static cv::Scalar compute (InputArrayOfArrays refImgs, InputArrayOfArrays cmpImgs, OutputArrayOfArrays qualityMaps, double maxPixelValue=QualityPSNR::MAX_PIXEL_VALUE_DEFAULT)
 static method for computing quality
 
static Ptr< QualityPSNRcreate (InputArrayOfArrays refImgs, double maxPixelValue=QualityPSNR::MAX_PIXEL_VALUE_DEFAULT)
 Create an object which calculates quality via mean square error.
 

Static Public Attributes

static const int MAX_PIXEL_VALUE_DEFAULT = 255
 Default maximum pixel value.
 

Protected Member Functions

 QualityPSNR (Ptr< QualityMSE > qualityMSE, double maxPixelValue)
 Constructor.
 

Protected Attributes

double _maxPixelValue = QualityPSNR::MAX_PIXEL_VALUE_DEFAULT
 
Ptr< QualityMSE_qualityMSE
 
- Protected Attributes inherited from cv::quality::QualityBase
std::vector< _quality_map_type_qualityMaps
 Output quality maps if generated by algorithm.
 

Additional Inherited Members

- Protected Types inherited from cv::quality::QualityBase
using _quality_map_type = cv::UMat
 internal quality map type default
 

Detailed Description

Full reference peak signal to noise ratio (PSNR) algorithm https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio.

Constructor & Destructor Documentation

cv::quality::QualityPSNR::QualityPSNR ( Ptr< QualityMSE qualityMSE,
double  maxPixelValue 
)
inlineprotected

Constructor.

Member Function Documentation

void cv::quality::QualityPSNR::clear ( )
inlinevirtual
Python:
None=cv.quality_QualityPSNR.clear()

Implements Algorithm::clear()

Reimplemented from cv::quality::QualityBase.

cv::Scalar cv::quality::QualityPSNR::compute ( InputArrayOfArrays  cmpImgs)
inlinevirtual
Python:
retval=cv.quality_QualityPSNR.compute(cmpImgs)
retval, qualityMaps=cv.quality_QualityPSNR.compute(refImgs, cmpImgs[, qualityMaps[, maxPixelValue]])
retval, qualityMaps=cv.quality.QualityPSNR_compute(refImgs, cmpImgs[, qualityMaps[, maxPixelValue]])

compute the PSNR

Parameters
cmpImgsComparison images
Returns
Per-channel PSNR value, or std::numeric_limits<double>::infinity() if the MSE between the two images == 0 The PSNR for multi-frame images is computed by calculating the average MSE of all frames and then generating the PSNR from that value

Implements cv::quality::QualityBase.

static cv::Scalar cv::quality::QualityPSNR::compute ( InputArrayOfArrays  refImgs,
InputArrayOfArrays  cmpImgs,
OutputArrayOfArrays  qualityMaps,
double  maxPixelValue = QualityPSNR::MAX_PIXEL_VALUE_DEFAULT 
)
inlinestatic
Python:
retval=cv.quality_QualityPSNR.compute(cmpImgs)
retval, qualityMaps=cv.quality_QualityPSNR.compute(refImgs, cmpImgs[, qualityMaps[, maxPixelValue]])
retval, qualityMaps=cv.quality.QualityPSNR_compute(refImgs, cmpImgs[, qualityMaps[, maxPixelValue]])

static method for computing quality

Parameters
refImgsreference image(s)
cmpImgscomparison image(s)
qualityMapsoutput quality map(s), or cv::noArray()
maxPixelValuemaximum per-channel value for any individual pixel; eg 255 for uint8 image
Returns
PSNR value, or std::numeric_limits<double>::infinity() if the MSE between the two images == 0 The PSNR for multi-frame images is computed by calculating the average MSE of all frames and then generating the PSNR from that value
static Ptr<QualityPSNR> cv::quality::QualityPSNR::create ( InputArrayOfArrays  refImgs,
double  maxPixelValue = QualityPSNR::MAX_PIXEL_VALUE_DEFAULT 
)
inlinestatic
Python:
retval=cv.quality.QualityPSNR_create(refImgs[, maxPixelValue])

Create an object which calculates quality via mean square error.

Parameters
refImgsinput image(s) to use as the source for comparison
maxPixelValuemaximum per-channel value for any individual pixel; eg 255 for uint8 image
bool cv::quality::QualityPSNR::empty ( ) const
inlinevirtual
Python:
retval=cv.quality_QualityPSNR.empty()

Implements Algorithm::empty()

Reimplemented from cv::quality::QualityBase.

double cv::quality::QualityPSNR::getMaxPixelValue ( ) const
inline
Python:
retval=cv.quality_QualityPSNR.getMaxPixelValue()

return the maximum pixel value used for PSNR computation

void cv::quality::QualityPSNR::setMaxPixelValue ( double  val)
inline
Python:
None=cv.quality_QualityPSNR.setMaxPixelValue(val)

sets the maximum pixel value used for PSNR computation

Parameters
valMaximum pixel value

Member Data Documentation

double cv::quality::QualityPSNR::_maxPixelValue = QualityPSNR::MAX_PIXEL_VALUE_DEFAULT
protected
Ptr<QualityMSE> cv::quality::QualityPSNR::_qualityMSE
protected
const int cv::quality::QualityPSNR::MAX_PIXEL_VALUE_DEFAULT = 255
static

Default maximum pixel value.


The documentation for this class was generated from the following file: