You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #2113 from clunietp:quality-refactor
* Simplified quality API
* Compilation fixes
* test fixes
* Test updates
* Test fixes
* Fixed brisque data file location for install, test
* Increase error epsilon to account for multiple architectures
- Inherit from `QualityBase`, and properly implement/override `compute`, `empty` and `clear` instance methods, along with a static `compute` method.
112
-
- Accept one or more `cv::Mat` or `cv::UMat` via `InputArrayOfArrays` for computation. Each input `cv::Mat` or `cv::UMat` may contain one or more channels. If the algorithm does not support multiple channels or multiple inputs, it should be documented and an appropriate assertion should be in place.
113
-
- Return a `cv::Scalar` with per-channel computed value. If multiple input images are provided, the resulting scalar should return the average result per channel.
110
+
- Accept one `cv::Mat` or `cv::UMat` via `InputArray` for computation. Each input `cv::Mat` or `cv::UMat` may contain one or more channels. If the algorithm does not support multiple channels, it should be documented and an appropriate assertion should be in place.
111
+
- Return a `cv::Scalar` with per-channel computed value
114
112
- Compute result via a single, static method named `compute` and via an overridden instance method (see `compute` in `qualitybase.hpp`).
115
-
- Perform any setup and/or pre-processing of reference images in the constructor, allowing for efficient computation when comparing the reference image(s) versus multiple comparison image(s). No-reference algorithms should accept images for evaluation in the `compute` method.
116
-
- Optionally compute resulting quality maps. Instance `compute` method should store them in `QualityBase::_qualityMaps` as the mat type defined by `QualityBase::_quality_map_type`, or override `QualityBase::getQualityMaps`. Static `compute` method should return them in an `OutputArrayOfArrays` parameter.
117
-
- Document algorithm in this readme and in its respective header. Documentation should include interpretation for the results of `compute` as well as the format of the output quality maps (if supported), along with any other notable usage information.
118
-
- Implement tests of static `compute` method and instance methods using single- and multi-channel images, multi-frame images, and OpenCL enabled and disabled
113
+
- Perform any setup and/or pre-processing of reference images in the constructor, allowing for efficient computation when comparing the reference image versus multiple comparison image(s). No-reference algorithms should accept images for evaluation in the `compute` method.
114
+
- Optionally compute resulting quality map. Instance `compute` method should store them in `QualityBase::_qualityMap` as the mat type defined by `QualityBase::_mat_type`, or override `QualityBase::getQualityMap`. Static `compute` method should return the quality map in an `OutputArray` parameter.
115
+
- Document algorithm in this readme and in its respective header. Documentation should include interpretation for the results of `compute` as well as the format of the output quality map (if supported), along with any other notable usage information.
116
+
- Implement tests of static `compute` method and instance methods using single- and multi-channel images and OpenCL enabled and disabled
Copy file name to clipboardExpand all lines: modules/quality/include/opencv2/quality/qualitybase.hpp
+11-16Lines changed: 11 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,6 @@
5
5
#ifndef OPENCV_QUALITYBASE_HPP
6
6
#defineOPENCV_QUALITYBASE_HPP
7
7
8
-
#include<vector>
9
8
#include<opencv2/core.hpp>
10
9
11
10
/**
@@ -21,7 +20,6 @@ namespace quality
21
20
//! @{
22
21
23
22
/************************************ Quality Base Class ************************************/
24
-
25
23
classCV_EXPORTS_W QualityBase
26
24
: public virtual Algorithm
27
25
{
@@ -32,34 +30,31 @@ class CV_EXPORTS_W QualityBase
32
30
33
31
/**
34
32
@brief Compute quality score per channel with the per-channel score in each element of the resulting cv::Scalar. See specific algorithm for interpreting result scores
35
-
@param cmpImgs comparison image(s), or image(s) to evalute for no-reference quality algorithms
33
+
@param img comparison image, or image to evalute for no-reference quality algorithms
@param model_file_path cv::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
39
-
@param range_file_path cv::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
37
+
@param model_file_path cv::String which contains a path to the BRISQUE model data, eg. /path/to/brisque_model_live.yml
38
+
@param range_file_path cv::String which contains a path to the BRISQUE range data, eg. /path/to/brisque_range_live.yml
@@ -49,12 +48,12 @@ class CV_EXPORTS_W QualityBRISQUE : public QualityBase {
49
48
50
49
/**
51
50
@brief static method for computing quality
52
-
@param imgs image(s) for which to compute quality (passed as Mat or vector<Mat> in C++ and as list of images in Python)
53
-
@param model_file_path cv::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
54
-
@param range_file_path cv::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
55
-
@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)
51
+
@param img image for which to compute quality
52
+
@param model_file_path cv::String which contains a path to the BRISQUE model data, eg. /path/to/brisque_model_live.yml
53
+
@param range_file_path cv::String which contains a path to the BRISQUE range data, eg. /path/to/brisque_range_live.yml
54
+
@returns cv::Scalar with the score in the first element. The score ranges from 0 (best quality) to 100 (worst quality)
0 commit comments