Class cv::ccm::ColorCorrectionModel#
Core class of ccm model. View details
#include <opencv2/photo/ccm.hpp>Collaboration diagram for cv::ccm::ColorCorrectionModel:
Detailed Description#
Core class of ccm model.
Produce a ColorCorrectionModel instance for inference
Constructor & Destructor Documentation#
ColorCorrectionModel()#
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()#
cv::ccm::ColorCorrectionModel::ColorCorrectionModel(
InputArray src,
InputArray colors,
ColorSpace refColorSpace )
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()#
cv::ccm::ColorCorrectionModel::ColorCorrectionModel(
InputArray src,
InputArray colors,
ColorSpace refColorSpace,
InputArray coloredPatchesMask )
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
ColorCorrectionModel()#
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:
COLORCHECKER_MACBETH, the Macbeth ColorChecker
COLORCHECKER_VINYL, the DKK ColorChecker
COLORCHECKER_DIGITAL_SG, the DigitalSG ColorChecker with 140 squares
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
Member Function Documentation#
compute()#
Mat cv::ccm::ColorCorrectionModel::compute()
Python:
cv.ccm.ColorCorrectionModel.compute() -> retval
make color correction
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
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()
Python:
cv.ccm.ColorCorrectionModel.getColorCorrectionMatrix() -> retval
getLoss()#
double cv::ccm::ColorCorrectionModel::getLoss()
Python:
cv.ccm.ColorCorrectionModel.getLoss() -> retval
getMask()#
Mat cv::ccm::ColorCorrectionModel::getMask()
Python:
cv.ccm.ColorCorrectionModel.getMask() -> retval
getRefLinearRGB()#
Mat cv::ccm::ColorCorrectionModel::getRefLinearRGB()
Python:
cv.ccm.ColorCorrectionModel.getRefLinearRGB() -> retval
getSrcLinearRGB()#
Mat cv::ccm::ColorCorrectionModel::getSrcLinearRGB()
Python:
cv.ccm.ColorCorrectionModel.getSrcLinearRGB() -> retval
getWeights()#
Mat cv::ccm::ColorCorrectionModel::getWeights()
Python:
cv.ccm.ColorCorrectionModel.getWeights() -> retval
read()#
void cv::ccm::ColorCorrectionModel::read(const cv::FileNode & node)
Python:
cv.ccm.ColorCorrectionModel.read(node)
setCcmType()#
void cv::ccm::ColorCorrectionModel::setCcmType(CcmType ccmType)
Python:
cv.ccm.ColorCorrectionModel.setCcmType(ccmType)
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)
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)
set Distance
Parameters
distance— the type of color distance; default: DISTANCE_CIE2000
setEpsilon()#
void cv::ccm::ColorCorrectionModel::setEpsilon(double epsilon)
Python:
cv.ccm.ColorCorrectionModel.setEpsilon(epsilon)
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)
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)
set Linear
Parameters
linearizationType— the method of linearization; default: LINEARIZATION_GAMMA
setLinearizationDegree()#
void cv::ccm::ColorCorrectionModel::setLinearizationDegree(int deg)
Python:
cv.ccm.ColorCorrectionModel.setLinearizationDegree(deg)
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)
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)
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)
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)
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)
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)
set WeightsList
Parameters
weightsList— the list of weight of each color; default: empty array
write()#
void cv::ccm::ColorCorrectionModel::write(cv::FileStorage & fs)
Python:
cv.ccm.ColorCorrectionModel.write(fs)
Member Data Documentation#
p#
std::shared_ptr< Impl > cv::ccm::ColorCorrectionModel::p
Source file#
The documentation for this class was generated from the following file:
opencv2/photo/ccm.hpp