Core class of ccm model.
More...
#include <opencv2/photo/ccm.hpp>
|
| | ColorCorrectionModel () |
| | ColorCorrectionModel (InputArray src, InputArray colors, ColorSpace refColorSpace) |
| | Color Correction Model.
|
| | ColorCorrectionModel (InputArray src, InputArray colors, ColorSpace refColorSpace, InputArray coloredPatchesMask) |
| | Color Correction Model.
|
| | ColorCorrectionModel (InputArray src, int constColor) |
| | Color Correction Model.
|
| Mat | compute () |
| | make color correction
|
| void | correctImage (InputArray src, OutputArray dst, bool islinear=false) |
| | Applies color correction to the input image using a fitted color correction matrix.
|
| Mat | getColorCorrectionMatrix () const |
| double | getLoss () const |
| Mat | getMask () const |
| Mat | getRefLinearRGB () const |
| Mat | getSrcLinearRGB () const |
| Mat | getWeights () const |
| void | read (const cv::FileNode &node) |
| void | setCcmType (CcmType ccmType) |
| | set ccmType
|
| void | setColorSpace (ColorSpace cs) |
| | set ColorSpace
|
| void | setDistance (DistanceType distance) |
| | set Distance
|
| void | setEpsilon (double epsilon) |
| | set Epsilon
|
| void | setInitialMethod (InitialMethodType initialMethodType) |
| | set InitialMethod
|
| void | setLinearization (LinearizationType linearizationType) |
| | set Linear
|
| void | setLinearizationDegree (int deg) |
| | set degree
|
| void | setLinearizationGamma (double gamma) |
| | set Gamma
|
| void | setMaxCount (int maxCount) |
| | set MaxCount
|
| void | setRGB (bool rgb) |
| | Set whether the input image is in RGB color space.
|
| void | setSaturatedThreshold (double lower, 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 (double weightsCoeff) |
| | set WeightCoeff
|
| void | setWeightsList (const Mat &weightsList) |
| | set WeightsList
|
| void | write (cv::FileStorage &fs) const |
Core class of ccm model.
Produce a ColorCorrectionModel instance for inference
◆ ColorCorrectionModel() [1/4]
| cv::ccm::ColorCorrectionModel::ColorCorrectionModel |
( |
| ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel( | | ) -> | <ccm_ColorCorrectionModel object> |
| cv.ccm.ColorCorrectionModel( | src, constColor | ) -> | <ccm_ColorCorrectionModel object> |
| cv.ccm.ColorCorrectionModel( | src, colors, refColorSpace | ) -> | <ccm_ColorCorrectionModel object> |
| cv.ccm.ColorCorrectionModel( | src, colors, refColorSpace, coloredPatchesMask | ) -> | <ccm_ColorCorrectionModel object> |
◆ ColorCorrectionModel() [2/4]
| cv::ccm::ColorCorrectionModel::ColorCorrectionModel |
( |
InputArray | src, |
|
|
int | constColor ) |
| Python: |
|---|
| cv.ccm.ColorCorrectionModel( | | ) -> | <ccm_ColorCorrectionModel object> |
| cv.ccm.ColorCorrectionModel( | src, constColor | ) -> | <ccm_ColorCorrectionModel object> |
| cv.ccm.ColorCorrectionModel( | src, colors, refColorSpace | ) -> | <ccm_ColorCorrectionModel object> |
| cv.ccm.ColorCorrectionModel( | src, colors, refColorSpace, coloredPatchesMask | ) -> | <ccm_ColorCorrectionModel object> |
Color Correction Model.
Supported list of color cards:
- Parameters
-
| 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 |
◆ ColorCorrectionModel() [3/4]
| Python: |
|---|
| cv.ccm.ColorCorrectionModel( | | ) -> | <ccm_ColorCorrectionModel object> |
| cv.ccm.ColorCorrectionModel( | src, constColor | ) -> | <ccm_ColorCorrectionModel object> |
| cv.ccm.ColorCorrectionModel( | src, colors, refColorSpace | ) -> | <ccm_ColorCorrectionModel object> |
| cv.ccm.ColorCorrectionModel( | src, colors, refColorSpace, coloredPatchesMask | ) -> | <ccm_ColorCorrectionModel object> |
Color Correction Model.
- Parameters
-
| 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]. |
| refColorSpace | the corresponding color space If the color type is some RGB, the format is RGB not BGR; |
◆ ColorCorrectionModel() [4/4]
| Python: |
|---|
| cv.ccm.ColorCorrectionModel( | | ) -> | <ccm_ColorCorrectionModel object> |
| cv.ccm.ColorCorrectionModel( | src, constColor | ) -> | <ccm_ColorCorrectionModel object> |
| cv.ccm.ColorCorrectionModel( | src, colors, refColorSpace | ) -> | <ccm_ColorCorrectionModel object> |
| cv.ccm.ColorCorrectionModel( | src, colors, refColorSpace, coloredPatchesMask | ) -> | <ccm_ColorCorrectionModel object> |
Color Correction Model.
- Parameters
-
| 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]. |
| refColorSpace | the corresponding color space If the color type is some RGB, the format is RGB not BGR; |
| coloredPatchesMask | binary mask indicating which patches are colored (non-gray) patches |
◆ compute()
| Mat cv::ccm::ColorCorrectionModel::compute |
( |
| ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.compute( | | ) -> | retval |
◆ correctImage()
| void cv::ccm::ColorCorrectionModel::correctImage |
( |
InputArray | src, |
|
|
OutputArray | dst, |
|
|
bool | islinear = false ) |
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.correctImage( | src[, dst[, islinear]] | ) -> | dst |
Applies color correction to the input image using a fitted color correction matrix.
The conventional ranges for R, G, and B channel values are:
- 0 to 255 for CV_8U images
- 0 to 65535 for CV_16U images
- 0 to 1 for CV_32F images
- Parameters
-
| src | Input 8-bit, 16-bit unsigned or 32-bit float 3-channel image.. |
| dst | Output image of the same size and datatype as src. |
| islinear | default false. |
◆ getColorCorrectionMatrix()
| Mat cv::ccm::ColorCorrectionModel::getColorCorrectionMatrix |
( |
| ) |
const |
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.getColorCorrectionMatrix( | | ) -> | 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 |
◆ getRefLinearRGB()
| Mat cv::ccm::ColorCorrectionModel::getRefLinearRGB |
( |
| ) |
const |
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.getRefLinearRGB( | | ) -> | retval |
◆ getSrcLinearRGB()
| Mat cv::ccm::ColorCorrectionModel::getSrcLinearRGB |
( |
| ) |
const |
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.getSrcLinearRGB( | | ) -> | retval |
◆ getWeights()
| Mat cv::ccm::ColorCorrectionModel::getWeights |
( |
| ) |
const |
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.getWeights( | | ) -> | retval |
◆ read()
| void cv::ccm::ColorCorrectionModel::read |
( |
const cv::FileNode & | node | ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.read( | node | ) -> | None |
◆ setCcmType()
| void cv::ccm::ColorCorrectionModel::setCcmType |
( |
CcmType | ccmType | ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.setCcmType( | ccmType | ) -> | None |
set ccmType
- Parameters
-
| ccmType | the shape of color correction matrix(CCM); default: CCM_LINEAR |
◆ setColorSpace()
| void cv::ccm::ColorCorrectionModel::setColorSpace |
( |
ColorSpace | cs | ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.setColorSpace( | cs | ) -> | None |
set ColorSpace
- Note
- It should be some RGB color space; Supported list of color cards:
- Parameters
-
| cs | the absolute color space that detected colors convert to; default: COLOR_SPACE_SRGB |
◆ setDistance()
| void cv::ccm::ColorCorrectionModel::setDistance |
( |
DistanceType | distance | ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.setDistance( | distance | ) -> | None |
◆ setEpsilon()
| void cv::ccm::ColorCorrectionModel::setEpsilon |
( |
double | epsilon | ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.setEpsilon( | epsilon | ) -> | None |
set Epsilon
- Parameters
-
| epsilon | used in MinProblemSolver-DownhillSolver; Terminal criteria to the algorithm; default: 1e-4; |
◆ setInitialMethod()
| void cv::ccm::ColorCorrectionModel::setInitialMethod |
( |
InitialMethodType | initialMethodType | ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.setInitialMethod( | initialMethodType | ) -> | None |
set InitialMethod
- Parameters
-
| initialMethodType | the method of calculating CCM initial value; default: INITIAL_METHOD_LEAST_SQUARE |
◆ setLinearization()
| void cv::ccm::ColorCorrectionModel::setLinearization |
( |
LinearizationType | linearizationType | ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.setLinearization( | linearizationType | ) -> | None |
◆ setLinearizationDegree()
| void cv::ccm::ColorCorrectionModel::setLinearizationDegree |
( |
int | deg | ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.setLinearizationDegree( | deg | ) -> | None |
set degree
- Note
- only valid when linear is set to
- Parameters
-
| deg | the degree of linearization polynomial default: 3 |
◆ setLinearizationGamma()
| void cv::ccm::ColorCorrectionModel::setLinearizationGamma |
( |
double | gamma | ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.setLinearizationGamma( | gamma | ) -> | None |
set Gamma
- Note
- only valid when linear is set to "gamma";
- Parameters
-
| gamma | the gamma value of gamma correction; default: 2.2; |
◆ setMaxCount()
| void cv::ccm::ColorCorrectionModel::setMaxCount |
( |
int | maxCount | ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.setMaxCount( | maxCount | ) -> | None |
set MaxCount
- Parameters
-
| maxCount | used in MinProblemSolver-DownhillSolver; Terminal criteria to the algorithm; default: 5000; |
◆ setRGB()
| void cv::ccm::ColorCorrectionModel::setRGB |
( |
bool | rgb | ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.setRGB( | rgb | ) -> | None |
Set whether the input image is in RGB color space.
- Parameters
-
| rgb | If true, the model expects input images in RGB format. If false, input is assumed to be in BGR (default). |
◆ setSaturatedThreshold()
| void cv::ccm::ColorCorrectionModel::setSaturatedThreshold |
( |
double | lower, |
|
|
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
-
| lower | the lower threshold to determine saturation; default: 0; |
| upper | the upper threshold to determine saturation; default: 0 |
◆ setWeightCoeff()
| void cv::ccm::ColorCorrectionModel::setWeightCoeff |
( |
double | weightsCoeff | ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.setWeightCoeff( | weightsCoeff | ) -> | None |
set WeightCoeff
- Parameters
-
| weightsCoeff | the exponent number of L* component of the reference color in CIE Lab color space; default: 0 |
◆ setWeightsList()
| void cv::ccm::ColorCorrectionModel::setWeightsList |
( |
const Mat & | weightsList | ) |
|
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.setWeightsList( | weightsList | ) -> | None |
set WeightsList
- Parameters
-
| weightsList | the list of weight of each color; default: empty array |
◆ write()
| Python: |
|---|
| cv.ccm.ColorCorrectionModel.write( | fs | ) -> | None |
The documentation for this class was generated from the following file: