Class ColorCorrectionModel
Core class of ccm model.
public class ColorCorrectionModel : UnmanagedObject, IDisposable
- Inheritance
-
ColorCorrectionModel
- Implements
- Inherited Members
Constructors
ColorCorrectionModel(Mat, ColorChecker)
Color Correction Model.
public ColorCorrectionModel(Mat src, ColorCorrectionModel.ColorChecker color)
Parameters
src
MatDetected colors of ColorChecker patches; the color type is RGB not BGR, and the color values are in [0, 1];
color
ColorCorrectionModel.ColorCheckerThe Built-in color card
ColorCorrectionModel(Mat, Mat, ColorSpace)
Color Correction Model.
public ColorCorrectionModel(Mat src, Mat colors, ColorCorrectionModel.ColorSpace refCs)
Parameters
src
MatDetected colors of ColorChecker patches; the color type is RGB not BGR, and the color values are in [0, 1];
colors
Matthe reference color values, the color values are in [0, 1].
refCs
ColorCorrectionModel.ColorSpaceThe corresponding color space. If the color type is some RGB, the format is RGB not BGR
ColorCorrectionModel(Mat, Mat, ColorSpace, Mat)
Color Correction Model.
public ColorCorrectionModel(Mat src, Mat colors, ColorCorrectionModel.ColorSpace refCs, Mat colored)
Parameters
src
MatDetected colors of ColorChecker patches; the color type is RGB not BGR, and the color values are in [0, 1];
colors
Matthe reference color values, the color values are in [0, 1].
refCs
ColorCorrectionModel.ColorSpaceThe corresponding color space. If the color type is some RGB, the format is RGB not BGR
colored
MatMask of colored color
Properties
Loss
Loss
public double Loss { get; }
Property Value
Methods
DisposeObject()
Release the unmanaged memory associated with this object
protected override void DisposeObject()
GetCCM()
Get the CCM
public Mat GetCCM()
Returns
- Mat
The CCM matrix
Infer(Mat, bool)
Infer using fitting ccm.
public Mat Infer(Mat img, bool isLinear = false)
Parameters
Returns
- Mat
The output array.
Run()
Make color correction
public void Run()
SetCcmType(CcmType)
Ccm type
public void SetCcmType(ColorCorrectionModel.CcmType value)
Parameters
value
ColorCorrectionModel.CcmTypeThe value
SetColorSpace(ColorSpace)
Color space
public void SetColorSpace(ColorCorrectionModel.ColorSpace value)
Parameters
value
ColorCorrectionModel.ColorSpaceThe value
SetDistanceType(DistanceType)
The type of color distance
public void SetDistanceType(ColorCorrectionModel.DistanceType value)
Parameters
value
ColorCorrectionModel.DistanceTypeThe value
SetLinearDegree(int)
The degree of linearization polynomial
public void SetLinearDegree(int value)
Parameters
value
intThe value
SetLinearGamma(double)
The gamma value of gamma correction
public void SetLinearGamma(double value)
Parameters
value
doubleThe value
SetLinearType(LinearType)
The method of linearization
public void SetLinearType(ColorCorrectionModel.LinearType value)
Parameters
value
ColorCorrectionModel.LinearTypeThe value
SetMaxCount(int)
Used in MinProblemSolver-DownhillSolver, terminal criteria to the algorithm
public void SetMaxCount(int value)
Parameters
value
intThe value
SetWeightCoeff(double)
The exponent number of L* component of the reference color in CIE Lab color space
public void SetWeightCoeff(double value)
Parameters
value
doubleThe value