OpenCV  4.9.0-dev
Open Source Computer Vision
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cv::quality::QualityBRISQUE Class Reference

BRISQUE (Blind/Referenceless Image Spatial Quality Evaluator) is a No Reference Image Quality Assessment (NR-IQA) algorithm. More...

#include <opencv2/quality/qualitybrisque.hpp>

Inheritance diagram for cv::quality::QualityBRISQUE:
Collaboration diagram for cv::quality::QualityBRISQUE:

Public Member Functions

cv::Scalar compute (InputArray img) CV_OVERRIDE
 Computes BRISQUE quality score for input image.
 
- Public Member Functions inherited from cv::quality::QualityBase
virtual ~QualityBase ()=default
 Destructor.
 
void clear () CV_OVERRIDE
 Implements Algorithm::clear()

 
bool empty () const CV_OVERRIDE
 Implements Algorithm::empty()

 
virtual void getQualityMap (OutputArray dst) const
 Returns output quality map that was 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
 
void write (const Ptr< FileStorage > &fs, const String &name=String()) const
 
virtual void write (FileStorage &fs) const
 Stores algorithm parameters in a file storage.
 
void write (FileStorage &fs, const String &name) const
 

Static Public Member Functions

static cv::Scalar compute (InputArray img, const cv::String &model_file_path, const cv::String &range_file_path)
 static method for computing quality
 
static void computeFeatures (InputArray img, OutputArray features)
 static method for computing image features used by the BRISQUE algorithm
 
static Ptr< QualityBRISQUEcreate (const cv::Ptr< cv::ml::SVM > &model, const cv::Mat &range)
 Create an object which calculates quality.
 
static Ptr< QualityBRISQUEcreate (const cv::String &model_file_path, const cv::String &range_file_path)
 Create an object which calculates quality.
 
- Static Public Member Functions inherited from cv::Algorithm
template<typename _Tp >
static Ptr< _Tpload (const String &filename, const String &objname=String())
 Loads algorithm from the file.
 
template<typename _Tp >
static Ptr< _TploadFromString (const String &strModel, const String &objname=String())
 Loads algorithm from a String.
 
template<typename _Tp >
static Ptr< _Tpread (const FileNode &fn)
 Reads algorithm from the file node.
 

Protected Member Functions

 QualityBRISQUE (const cv::Ptr< cv::ml::SVM > &model, const cv::Mat &range)
 Internal constructor.
 
 QualityBRISQUE (const cv::String &model_file_path, const cv::String &range_file_path)
 Internal constructor.
 
- Protected Member Functions inherited from cv::Algorithm
void writeFormat (FileStorage &fs) const
 

Protected Attributes

cv::Ptr< cv::ml::SVM_model = nullptr
 
cv::Mat _range
 
- Protected Attributes inherited from cv::quality::QualityBase
_mat_type _qualityMap
 Output quality maps if generated by algorithm.
 

Additional Inherited Members

- Protected Types inherited from cv::quality::QualityBase
using _mat_type = cv::UMat
 internal mat type default
 

Detailed Description

BRISQUE (Blind/Referenceless Image Spatial Quality Evaluator) is a No Reference Image Quality Assessment (NR-IQA) algorithm.

BRISQUE computes a score based on extracting Natural Scene Statistics (https://en.wikipedia.org/wiki/Scene_statistics) and calculating feature vectors. See Mittal et al. [191] for original paper and original implementation [190] .

A trained model is provided in the /samples/ directory and is trained on the LIVE-R2 database [126] as in the original implementation. When evaluated against the TID2008 database [198] , the SROCC is -0.8424 versus the SROCC of -0.8354 in the original implementation. C++ code for the BRISQUE LIVE-R2 trainer and TID2008 evaluator are also provided in the /samples/ directory.

Constructor & Destructor Documentation

◆ QualityBRISQUE() [1/2]

cv::quality::QualityBRISQUE::QualityBRISQUE ( const cv::String model_file_path,
const cv::String range_file_path 
)
protected

Internal constructor.

◆ QualityBRISQUE() [2/2]

cv::quality::QualityBRISQUE::QualityBRISQUE ( const cv::Ptr< cv::ml::SVM > &  model,
const cv::Mat range 
)
inlineprotected

Internal constructor.

Member Function Documentation

◆ compute() [1/2]

cv::Scalar cv::quality::QualityBRISQUE::compute ( InputArray  img)
virtual
Python:
cv.quality.QualityBRISQUE.compute(img) -> retval
cv.quality.QualityBRISQUE.compute(img, model_file_path, range_file_path) -> retval
cv.quality.QualityBRISQUE_compute(img, model_file_path, range_file_path) -> retval

Computes BRISQUE quality score for input image.

Parameters
imgImage for which to compute quality
Returns
cv::Scalar with the score in the first element. The score ranges from 0 (best quality) to 100 (worst quality)

Implements cv::quality::QualityBase.

◆ compute() [2/2]

static cv::Scalar cv::quality::QualityBRISQUE::compute ( InputArray  img,
const cv::String model_file_path,
const cv::String range_file_path 
)
static
Python:
cv.quality.QualityBRISQUE.compute(img) -> retval
cv.quality.QualityBRISQUE.compute(img, model_file_path, range_file_path) -> retval
cv.quality.QualityBRISQUE_compute(img, model_file_path, range_file_path) -> retval

static method for computing quality

Parameters
imgimage for which to compute quality
model_file_pathcv::String which contains a path to the BRISQUE model data, eg. /path/to/brisque_model_live.yml
range_file_pathcv::String which contains a path to the BRISQUE range data, eg. /path/to/brisque_range_live.yml
Returns
cv::Scalar with the score in the first element. The score ranges from 0 (best quality) to 100 (worst quality)

◆ computeFeatures()

static void cv::quality::QualityBRISQUE::computeFeatures ( InputArray  img,
OutputArray  features 
)
static
Python:
cv.quality.QualityBRISQUE.computeFeatures(img[, features]) -> features
cv.quality.QualityBRISQUE_computeFeatures(img[, features]) -> features

static method for computing image features used by the BRISQUE algorithm

Parameters
imgimage (BGR(A) or grayscale) for which to compute features
featuresoutput row vector of features to cv::Mat or cv::UMat

◆ create() [1/2]

static Ptr< QualityBRISQUE > cv::quality::QualityBRISQUE::create ( const cv::Ptr< cv::ml::SVM > &  model,
const cv::Mat range 
)
static
Python:
cv.quality.QualityBRISQUE.create(model_file_path, range_file_path) -> retval
cv.quality.QualityBRISQUE.create(model, range) -> retval
cv.quality.QualityBRISQUE_create(model_file_path, range_file_path) -> retval
cv.quality.QualityBRISQUE_create(model, range) -> retval

Create an object which calculates quality.

Parameters
modelcv::Ptr<cv::ml::SVM> which contains a loaded BRISQUE model
rangecv::Mat which contains BRISQUE range data

◆ create() [2/2]

static Ptr< QualityBRISQUE > cv::quality::QualityBRISQUE::create ( const cv::String model_file_path,
const cv::String range_file_path 
)
static
Python:
cv.quality.QualityBRISQUE.create(model_file_path, range_file_path) -> retval
cv.quality.QualityBRISQUE.create(model, range) -> retval
cv.quality.QualityBRISQUE_create(model_file_path, range_file_path) -> retval
cv.quality.QualityBRISQUE_create(model, range) -> retval

Create an object which calculates quality.

Parameters
model_file_pathcv::String which contains a path to the BRISQUE model data, eg. /path/to/brisque_model_live.yml
range_file_pathcv::String which contains a path to the BRISQUE range data, eg. /path/to/brisque_range_live.yml

Member Data Documentation

◆ _model

cv::Ptr<cv::ml::SVM> cv::quality::QualityBRISQUE::_model = nullptr
protected

◆ _range

cv::Mat cv::quality::QualityBRISQUE::_range
protected

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