OpenCV  4.1.0
Open Source Computer Vision
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:
cv::quality::QualityBase cv::Algorithm

Public Member Functions

cv::Scalar compute (InputArrayOfArrays imgs) CV_OVERRIDE
 Computes BRISQUE quality score for input images.
 
- 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 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 imgs, 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::String &model_file_path="", const cv::String &range_file_path="")
 Create an object which calculates quality.
 
static Ptr< QualityBRISQUEcreate (const cv::Ptr< cv::ml::SVM > &model, const cv::Mat &range)
 Create an object which calculates quality.
 

Protected Member Functions

 QualityBRISQUE (const cv::String &model_file_path, const cv::String &range_file_path)
 Internal constructor.
 
 QualityBRISQUE (const cv::Ptr< cv::ml::SVM > &model, const cv::Mat &range)
 Internal constructor.
 

Protected Attributes

cv::Ptr< cv::ml::SVM_model = nullptr
 
cv::Mat _range
 
- 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

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.Mittal2 for original paper and original implementationMittal2_software .

A trained model is provided in the /samples/ directory and is trained on the LIVE-R2 databaseSheikh as in the original implementation. When evaluated against the TID2008 databasePonomarenko , 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

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

Internal constructor.

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

Internal constructor.

Member Function Documentation

cv::Scalar cv::quality::QualityBRISQUE::compute ( InputArrayOfArrays  imgs)
virtual
Python:
retval=cv.quality_QualityBRISQUE.compute(imgs)
retval=cv.quality_QualityBRISQUE.compute(imgs, model_file_path, range_file_path)
retval=cv.quality.QualityBRISQUE_compute(imgs, model_file_path, range_file_path)

Computes BRISQUE quality score for input images.

Parameters
imgsImages for which to compute quality (should be passed as a vector<Mat> in C++ and list of images in Python)
Returns
Score (averaged over individual scores of all images) ranging from 0 to 100 (0 denotes the best quality and 100 denotes the worst quality). The format of the score is: {score, 0., 0., 0.}

Implements cv::quality::QualityBase.

static cv::Scalar cv::quality::QualityBRISQUE::compute ( InputArrayOfArrays  imgs,
const cv::String model_file_path,
const cv::String range_file_path 
)
static
Python:
retval=cv.quality_QualityBRISQUE.compute(imgs)
retval=cv.quality_QualityBRISQUE.compute(imgs, model_file_path, range_file_path)
retval=cv.quality.QualityBRISQUE_compute(imgs, model_file_path, range_file_path)

static method for computing quality

Parameters
imgsimage(s) for which to compute quality (passed as Mat or vector<Mat> in C++ and as list of images in Python)
model_file_pathcv::String which contains a path to the BRISQUE model data. If empty, attempts to load from ${OPENCV_DIR}/testdata/contrib/quality/brisque_model_live.yml
range_file_pathcv::String which contains a path to the BRISQUE range data. If empty, attempts to load from ${OPENCV_DIR}/testdata/contrib/quality/brisque_range_live.yml
Returns
cv::Scalar result of format {std::double score, 0., 0., 0.}. Score ranges from 0 to 100 (100 means worst and 0 means best)
static void cv::quality::QualityBRISQUE::computeFeatures ( InputArray  img,
OutputArray  features 
)
static
Python:
features=cv.quality.QualityBRISQUE_computeFeatures(img[, 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
static Ptr<QualityBRISQUE> cv::quality::QualityBRISQUE::create ( const cv::String model_file_path = "",
const cv::String range_file_path = "" 
)
static
Python:
retval=cv.quality.QualityBRISQUE_create([, model_file_path[, range_file_path]])
retval=cv.quality.QualityBRISQUE_create(model, range)

Create an object which calculates quality.

Parameters
model_file_pathcv::String which contains a path to the BRISQUE model data. If empty, attempts to load from ${OPENCV_DIR}/testdata/contrib/quality/brisque_model_live.yml
range_file_pathcv::String which contains a path to the BRISQUE range data. If empty, attempts to load from ${OPENCV_DIR}/testdata/contrib/quality/brisque_range_live.yml
static Ptr<QualityBRISQUE> cv::quality::QualityBRISQUE::create ( const cv::Ptr< cv::ml::SVM > &  model,
const cv::Mat range 
)
static
Python:
retval=cv.quality.QualityBRISQUE_create([, model_file_path[, range_file_path]])
retval=cv.quality.QualityBRISQUE_create(model, range)

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

Member Data Documentation

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

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