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. More...
 
- Public Member Functions inherited from cv::quality::QualityBase
virtual ~QualityBase ()=default
 Destructor. More...
 
void clear () CV_OVERRIDE
 Implements Algorithm::clear() More...
 
bool empty () const CV_OVERRIDE
 Implements Algorithm::empty() More...
 
virtual void getQualityMaps (OutputArrayOfArrays dst) const
 Returns output quality map images that were generated during computation, if supported by the algorithm. More...
 
- 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. More...
 
virtual void save (const String &filename) const
 
virtual void write (FileStorage &fs) const
 Stores algorithm parameters in a file storage. More...
 
void write (const Ptr< FileStorage > &fs, const String &name=String()) const
 simplified API for language bindings This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 

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

Protected Member Functions

 QualityBRISQUE (const cv::String &model_file_path, const cv::String &range_file_path)
 Internal constructor. More...
 
 QualityBRISQUE (const cv::Ptr< cv::ml::SVM > &model, const cv::Mat &range)
 Internal constructor. More...
 
- 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
std::vector< _quality_map_type_qualityMaps
 Output quality maps if generated by algorithm. More...
 

Additional Inherited Members

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

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. [150] for original paper and original implementation [149] .

A trained model is provided in the /samples/ directory and is trained on the LIVE-R2 database [96] as in the original implementation. When evaluated against the TID2008 database [155] , 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 ( 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.

§ compute() [2/2]

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)

§ computeFeatures()

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

§ create() [1/2]

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

§ create() [2/2]

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

§ _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: