![]() |
OpenCV
4.6.0
Open Source Computer Vision
|
Core class of ccm model. More...
#include <opencv2/mcc/ccm.hpp>
Public Member Functions | |
ColorCorrectionModel (const Mat &src, CONST_COLOR constcolor) | |
Color Correction Model. More... | |
ColorCorrectionModel (const Mat &src, Mat colors, COLOR_SPACE ref_cs) | |
Color Correction Model. More... | |
ColorCorrectionModel (const Mat &src, Mat colors, COLOR_SPACE ref_cs, Mat colored) | |
Color Correction Model. More... | |
Mat | get_dst_rgbl () const |
Mat | get_src_rgbl () const |
Mat | getCCM () const |
double | getLoss () const |
Mat | getMask () const |
Mat | getWeights () const |
Mat | infer (const Mat &img, bool islinear=false) |
Infer using fitting ccm. More... | |
void | run () |
make color correction More... | |
void | setCCM_TYPE (CCM_TYPE ccm_type) |
set ccm_type More... | |
void | setColorSpace (COLOR_SPACE cs) |
set ColorSpace More... | |
void | setDistance (DISTANCE_TYPE distance) |
set Distance More... | |
void | setEpsilon (const double &epsilon) |
set Epsilon More... | |
void | setInitialMethod (INITIAL_METHOD_TYPE initial_method_type) |
set InitialMethod More... | |
void | setLinear (LINEAR_TYPE linear_type) |
set Linear More... | |
void | setLinearDegree (const int °) |
set degree More... | |
void | setLinearGamma (const double &gamma) |
set Gamma More... | |
void | setMaxCount (const int &max_count) |
set MaxCount More... | |
void | setSaturatedThreshold (const double &lower, const double &upper) |
set SaturatedThreshold. The colors in the closed interval [lower, upper] are reserved to participate in the calculation of the loss function and initialization parameters More... | |
void | setWeightCoeff (const double &weights_coeff) |
set WeightCoeff More... | |
void | setWeightsList (const Mat &weights_list) |
set WeightsList More... | |
Core class of ccm model.
Produce a ColorCorrectionModel instance for inference
cv::ccm::ColorCorrectionModel::ColorCorrectionModel | ( | const Mat & | src, |
CONST_COLOR | constcolor | ||
) |
Color Correction Model.
Supported list of color cards:
src | detected colors of ColorChecker patches; the color type is RGB not BGR, and the color values are in [0, 1]; |
constcolor | the Built-in color card |
cv::ccm::ColorCorrectionModel::ColorCorrectionModel | ( | const Mat & | src, |
Mat | colors, | ||
COLOR_SPACE | ref_cs | ||
) |
Color Correction Model.
src | detected colors of ColorChecker patches; the color type is RGB not BGR, and the color values are in [0, 1]; |
colors | the reference color values, the color values are in [0, 1]. |
ref_cs | the corresponding color space If the color type is some RGB, the format is RGB not BGR; |
cv::ccm::ColorCorrectionModel::ColorCorrectionModel | ( | const Mat & | src, |
Mat | colors, | ||
COLOR_SPACE | ref_cs, | ||
Mat | colored | ||
) |
Color Correction Model.
src | detected colors of ColorChecker patches; the color type is RGB not BGR, and the color values are in [0, 1]; |
colors | the reference color values, the color values are in [0, 1]. |
ref_cs | the corresponding color space If the color type is some RGB, the format is RGB not BGR; |
colored | mask of colored color |
Mat cv::ccm::ColorCorrectionModel::get_dst_rgbl | ( | ) | const |
Mat cv::ccm::ColorCorrectionModel::get_src_rgbl | ( | ) | const |
Mat cv::ccm::ColorCorrectionModel::getCCM | ( | ) | const |
double cv::ccm::ColorCorrectionModel::getLoss | ( | ) | const |
Mat cv::ccm::ColorCorrectionModel::getMask | ( | ) | const |
Mat cv::ccm::ColorCorrectionModel::getWeights | ( | ) | const |
Infer using fitting ccm.
img | the input image. |
islinear | default false. |
void cv::ccm::ColorCorrectionModel::run | ( | ) |
make color correction
void cv::ccm::ColorCorrectionModel::setCCM_TYPE | ( | CCM_TYPE | ccm_type | ) |
set ccm_type
ccm_type | the shape of color correction matrix(CCM); default: CCM_3x3 |
void cv::ccm::ColorCorrectionModel::setColorSpace | ( | COLOR_SPACE | cs | ) |
set ColorSpace
cs | the absolute color space that detected colors convert to; default: COLOR_SPACE_sRGB |
void cv::ccm::ColorCorrectionModel::setDistance | ( | DISTANCE_TYPE | distance | ) |
set Distance
distance | the type of color distance; default: DISTANCE_CIE2000 |
void cv::ccm::ColorCorrectionModel::setEpsilon | ( | const double & | epsilon | ) |
set Epsilon
epsilon | used in MinProblemSolver-DownhillSolver; Terminal criteria to the algorithm; default: 1e-4; |
void cv::ccm::ColorCorrectionModel::setInitialMethod | ( | INITIAL_METHOD_TYPE | initial_method_type | ) |
set InitialMethod
initial_method_type | the method of calculating CCM initial value; default: INITIAL_METHOD_LEAST_SQUARE |
void cv::ccm::ColorCorrectionModel::setLinear | ( | LINEAR_TYPE | linear_type | ) |
set Linear
linear_type | the method of linearization; default: LINEARIZATION_GAMMA |
void cv::ccm::ColorCorrectionModel::setLinearDegree | ( | const int & | deg | ) |
set degree
deg | the degree of linearization polynomial; default: 3 |
void cv::ccm::ColorCorrectionModel::setLinearGamma | ( | const double & | gamma | ) |
set Gamma
gamma | the gamma value of gamma correction; default: 2.2; |
void cv::ccm::ColorCorrectionModel::setMaxCount | ( | const int & | max_count | ) |
set MaxCount
max_count | used in MinProblemSolver-DownhillSolver; Terminal criteria to the algorithm; default: 5000; |
void cv::ccm::ColorCorrectionModel::setSaturatedThreshold | ( | const double & | lower, |
const double & | upper | ||
) |
set SaturatedThreshold. The colors in the closed interval [lower, upper] are reserved to participate in the calculation of the loss function and initialization parameters
lower | the lower threshold to determine saturation; default: 0; |
upper | the upper threshold to determine saturation; default: 0 |
void cv::ccm::ColorCorrectionModel::setWeightCoeff | ( | const double & | weights_coeff | ) |
set WeightCoeff
weights_coeff | the exponent number of L* component of the reference color in CIE Lab color space; default: 0 |
void cv::ccm::ColorCorrectionModel::setWeightsList | ( | const Mat & | weights_list | ) |
set WeightsList
weights_list | the list of weight of each color; default: empty array |