OpenCV  5.0.0-pre
Open Source Computer Vision
Loading...
Searching...
No Matches
Public Member Functions | List of all members
cv::ccm::ColorCorrectionModel Class Reference

Core class of ccm model. More...

#include <opencv2/mcc/ccm.hpp>

Collaboration diagram for cv::ccm::ColorCorrectionModel:

Public Member Functions

 ColorCorrectionModel (const Mat &src, CONST_COLOR constcolor)
 Color Correction Model.
 
 ColorCorrectionModel (const Mat &src, Mat colors, COLOR_SPACE ref_cs)
 Color Correction Model.
 
 ColorCorrectionModel (const Mat &src, Mat colors, COLOR_SPACE ref_cs, Mat colored)
 Color Correction Model.
 
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.
 
void run ()
 make color correction
 
void setCCM_TYPE (CCM_TYPE ccm_type)
 set ccm_type
 
void setColorSpace (COLOR_SPACE cs)
 set ColorSpace
 
void setDistance (DISTANCE_TYPE distance)
 set Distance
 
void setEpsilon (const double &epsilon)
 set Epsilon
 
void setInitialMethod (INITIAL_METHOD_TYPE initial_method_type)
 set InitialMethod
 
void setLinear (LINEAR_TYPE linear_type)
 set Linear
 
void setLinearDegree (const int &deg)
 set degree
 
void setLinearGamma (const double &gamma)
 set Gamma
 
void setMaxCount (const int &max_count)
 set MaxCount
 
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
 
void setWeightCoeff (const double &weights_coeff)
 set WeightCoeff
 
void setWeightsList (const Mat &weights_list)
 set WeightsList
 

Detailed Description

Core class of ccm model.

Produce a ColorCorrectionModel instance for inference

Constructor & Destructor Documentation

◆ ColorCorrectionModel() [1/3]

cv::ccm::ColorCorrectionModel::ColorCorrectionModel ( const Mat src,
CONST_COLOR  constcolor 
)
Python:
cv.ccm.ColorCorrectionModel(src, constcolor) -> <ccm_ColorCorrectionModel object>
cv.ccm.ColorCorrectionModel(src, colors, ref_cs) -> <ccm_ColorCorrectionModel object>
cv.ccm.ColorCorrectionModel(src, colors, ref_cs, colored) -> <ccm_ColorCorrectionModel object>

Color Correction Model.

Supported list of color cards:

Parameters
srcdetected colors of ColorChecker patches;
the color type is RGB not BGR, and the color values are in [0, 1];
constcolorthe Built-in color card

◆ ColorCorrectionModel() [2/3]

cv::ccm::ColorCorrectionModel::ColorCorrectionModel ( const Mat src,
Mat  colors,
COLOR_SPACE  ref_cs 
)
Python:
cv.ccm.ColorCorrectionModel(src, constcolor) -> <ccm_ColorCorrectionModel object>
cv.ccm.ColorCorrectionModel(src, colors, ref_cs) -> <ccm_ColorCorrectionModel object>
cv.ccm.ColorCorrectionModel(src, colors, ref_cs, colored) -> <ccm_ColorCorrectionModel object>

Color Correction Model.

Parameters
srcdetected colors of ColorChecker patches;
the color type is RGB not BGR, and the color values are in [0, 1];
colorsthe reference color values, the color values are in [0, 1].
ref_csthe corresponding color space If the color type is some RGB, the format is RGB not BGR;

◆ ColorCorrectionModel() [3/3]

cv::ccm::ColorCorrectionModel::ColorCorrectionModel ( const Mat src,
Mat  colors,
COLOR_SPACE  ref_cs,
Mat  colored 
)
Python:
cv.ccm.ColorCorrectionModel(src, constcolor) -> <ccm_ColorCorrectionModel object>
cv.ccm.ColorCorrectionModel(src, colors, ref_cs) -> <ccm_ColorCorrectionModel object>
cv.ccm.ColorCorrectionModel(src, colors, ref_cs, colored) -> <ccm_ColorCorrectionModel object>

Color Correction Model.

Parameters
srcdetected colors of ColorChecker patches;
the color type is RGB not BGR, and the color values are in [0, 1];
colorsthe reference color values, the color values are in [0, 1].
ref_csthe corresponding color space If the color type is some RGB, the format is RGB not BGR;
coloredmask of colored color

Member Function Documentation

◆ get_dst_rgbl()

Mat cv::ccm::ColorCorrectionModel::get_dst_rgbl ( ) const
Python:
cv.ccm.ColorCorrectionModel.get_dst_rgbl() -> retval

◆ get_src_rgbl()

Mat cv::ccm::ColorCorrectionModel::get_src_rgbl ( ) const
Python:
cv.ccm.ColorCorrectionModel.get_src_rgbl() -> retval

◆ getCCM()

Mat cv::ccm::ColorCorrectionModel::getCCM ( ) const
Python:
cv.ccm.ColorCorrectionModel.getCCM() -> retval

◆ getLoss()

double cv::ccm::ColorCorrectionModel::getLoss ( ) const
Python:
cv.ccm.ColorCorrectionModel.getLoss() -> retval

◆ getMask()

Mat cv::ccm::ColorCorrectionModel::getMask ( ) const
Python:
cv.ccm.ColorCorrectionModel.getMask() -> retval

◆ getWeights()

Mat cv::ccm::ColorCorrectionModel::getWeights ( ) const
Python:
cv.ccm.ColorCorrectionModel.getWeights() -> retval

◆ infer()

Mat cv::ccm::ColorCorrectionModel::infer ( const Mat img,
bool  islinear = false 
)
Python:
cv.ccm.ColorCorrectionModel.infer(img[, islinear]) -> retval

Infer using fitting ccm.

Parameters
imgthe input image.
islineardefault false.
Returns
the output array.

◆ run()

void cv::ccm::ColorCorrectionModel::run ( )
Python:
cv.ccm.ColorCorrectionModel.run() -> None

make color correction

◆ setCCM_TYPE()

void cv::ccm::ColorCorrectionModel::setCCM_TYPE ( CCM_TYPE  ccm_type)
Python:
cv.ccm.ColorCorrectionModel.setCCM_TYPE(ccm_type) -> None

set ccm_type

Parameters
ccm_typethe shape of color correction matrix(CCM);
default: CCM_3x3

◆ setColorSpace()

void cv::ccm::ColorCorrectionModel::setColorSpace ( COLOR_SPACE  cs)
Python:
cv.ccm.ColorCorrectionModel.setColorSpace(cs) -> None

set ColorSpace

Note
It should be some RGB color space; Supported list of color cards:
Parameters
csthe absolute color space that detected colors convert to;
default: COLOR_SPACE_sRGB

◆ setDistance()

void cv::ccm::ColorCorrectionModel::setDistance ( DISTANCE_TYPE  distance)
Python:
cv.ccm.ColorCorrectionModel.setDistance(distance) -> None

set Distance

Parameters
distancethe type of color distance;
default: DISTANCE_CIE2000

◆ setEpsilon()

void cv::ccm::ColorCorrectionModel::setEpsilon ( const double &  epsilon)
Python:
cv.ccm.ColorCorrectionModel.setEpsilon(epsilon) -> None

set Epsilon

Parameters
epsilonused in MinProblemSolver-DownhillSolver;
Terminal criteria to the algorithm;
default: 1e-4;

◆ setInitialMethod()

void cv::ccm::ColorCorrectionModel::setInitialMethod ( INITIAL_METHOD_TYPE  initial_method_type)
Python:
cv.ccm.ColorCorrectionModel.setInitialMethod(initial_method_type) -> None

set InitialMethod

Parameters
initial_method_typethe method of calculating CCM initial value;
default: INITIAL_METHOD_LEAST_SQUARE

◆ setLinear()

void cv::ccm::ColorCorrectionModel::setLinear ( LINEAR_TYPE  linear_type)
Python:
cv.ccm.ColorCorrectionModel.setLinear(linear_type) -> None

set Linear

Parameters
linear_typethe method of linearization;
default: LINEARIZATION_GAMMA

◆ setLinearDegree()

void cv::ccm::ColorCorrectionModel::setLinearDegree ( const int &  deg)
Python:
cv.ccm.ColorCorrectionModel.setLinearDegree(deg) -> None

set degree

Note
only valid when linear is set to
Parameters
degthe degree of linearization polynomial;
default: 3

◆ setLinearGamma()

void cv::ccm::ColorCorrectionModel::setLinearGamma ( const double &  gamma)
Python:
cv.ccm.ColorCorrectionModel.setLinearGamma(gamma) -> None

set Gamma

Note
only valid when linear is set to "gamma";
Parameters
gammathe gamma value of gamma correction;
default: 2.2;

◆ setMaxCount()

void cv::ccm::ColorCorrectionModel::setMaxCount ( const int &  max_count)
Python:
cv.ccm.ColorCorrectionModel.setMaxCount(max_count) -> None

set MaxCount

Parameters
max_countused in MinProblemSolver-DownhillSolver;
Terminal criteria to the algorithm;
default: 5000;

◆ setSaturatedThreshold()

void cv::ccm::ColorCorrectionModel::setSaturatedThreshold ( const double &  lower,
const double &  upper 
)
Python:
cv.ccm.ColorCorrectionModel.setSaturatedThreshold(lower, upper) -> None

set SaturatedThreshold. The colors in the closed interval [lower, upper] are reserved to participate in the calculation of the loss function and initialization parameters

Parameters
lowerthe lower threshold to determine saturation;
default: 0;
upperthe upper threshold to determine saturation;
default: 0

◆ setWeightCoeff()

void cv::ccm::ColorCorrectionModel::setWeightCoeff ( const double &  weights_coeff)
Python:
cv.ccm.ColorCorrectionModel.setWeightCoeff(weights_coeff) -> None

set WeightCoeff

Parameters
weights_coeffthe exponent number of L* component of the reference color in CIE Lab color space;
default: 0

◆ setWeightsList()

void cv::ccm::ColorCorrectionModel::setWeightsList ( const Mat weights_list)
Python:
cv.ccm.ColorCorrectionModel.setWeightsList(weights_list) -> None

set WeightsList

Parameters
weights_listthe list of weight of each color;
default: empty array

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