View Source Evision.CCM.ColorCorrectionModel (Evision v1.0.0-rc.0)
Summary
Functions
ColorCorrectionModel
Color Correction Model
Color Correction Model
Color Correction Model
make color correction
Applies color correction to the input image using a fitted color correction matrix.
Applies color correction to the input image using a fitted color correction matrix.
getColorCorrectionMatrix
getLoss
getMask
getRefLinearRGB
getSrcLinearRGB
getWeights
read
set ccmType
set ColorSpace
set Distance
set Epsilon
set InitialMethod
set Linear
set degree
set Gamma
set MaxCount
Set whether the input image is in RGB color space
set SaturatedThreshold. The colors in the closed interval [lower, upper] are reserved to participate in the calculation of the loss function and initialization parameters
set WeightCoeff
set WeightsList
write
Types
@type t() :: %Evision.CCM.ColorCorrectionModel{ref: reference()}
Type that represents an CCM.ColorCorrectionModel struct.
ref.
reference()The underlying erlang resource variable.
Functions
ColorCorrectionModel
Return
- self:
ColorCorrectionModel
Python prototype (for reference only):
ColorCorrectionModel() -> <ccm_ColorCorrectionModel object>
@spec colorCorrectionModel(Evision.Mat.maybe_mat_in(), integer()) :: t() | {:error, String.t()}
Color Correction Model
Positional Arguments
src:
Evision.Mat.detected colors of ColorChecker patches; the color type is RGB not BGR, and the color values are in [0, 1];
constColor:
integer().the Built-in color card
Return
- self:
ColorCorrectionModel
Supported list of color cards:
- @ref COLORCHECKER_MACBETH, the Macbeth ColorChecker
- @ref COLORCHECKER_VINYL, the DKK ColorChecker
- @ref COLORCHECKER_DIGITAL_SG, the DigitalSG ColorChecker with 140 squares
Python prototype (for reference only):
ColorCorrectionModel(src, constColor) -> <ccm_ColorCorrectionModel object>
@spec colorCorrectionModel( Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in(), Evision.CCM.ColorSpace.t() ) :: t() | {:error, String.t()}
Color Correction Model
Positional Arguments
src:
Evision.Mat.detected colors of ColorChecker patches; the color type is RGB not BGR, and the color values are in [0, 1];
colors:
Evision.Mat.the reference color values, the color values are in [0, 1].
refColorSpace:
ColorSpace.the corresponding color space If the color type is some RGB, the format is RGB not BGR;
Return
- self:
ColorCorrectionModel
Python prototype (for reference only):
ColorCorrectionModel(src, colors, refColorSpace) -> <ccm_ColorCorrectionModel object>
colorCorrectionModel(src, colors, refColorSpace, coloredPatchesMask)
View Source@spec colorCorrectionModel( Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in(), Evision.CCM.ColorSpace.t(), Evision.Mat.maybe_mat_in() ) :: t() | {:error, String.t()}
Color Correction Model
Positional Arguments
src:
Evision.Mat.detected colors of ColorChecker patches; the color type is RGB not BGR, and the color values are in [0, 1];
colors:
Evision.Mat.the reference color values, the color values are in [0, 1].
refColorSpace:
ColorSpace.the corresponding color space If the color type is some RGB, the format is RGB not BGR;
coloredPatchesMask:
Evision.Mat.binary mask indicating which patches are colored (non-gray) patches
Return
- self:
ColorCorrectionModel
Python prototype (for reference only):
ColorCorrectionModel(src, colors, refColorSpace, coloredPatchesMask) -> <ccm_ColorCorrectionModel object>
@spec compute(Keyword.t()) :: any() | {:error, String.t()}
@spec compute(t()) :: Evision.Mat.t() | {:error, String.t()}
make color correction
Positional Arguments
- self:
Evision.CCM.ColorCorrectionModel.t()
Return
- retval:
Evision.Mat.t()
Python prototype (for reference only):
compute() -> retval
@spec correctImage(t(), Evision.Mat.maybe_mat_in()) :: Evision.Mat.t() | {:error, String.t()}
Applies color correction to the input image using a fitted color correction matrix.
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()src:
Evision.Mat.Input 8-bit, 16-bit unsigned or 32-bit float 3-channel image..
Keyword Arguments
islinear:
bool.default false.
Return
dst:
Evision.Mat.t().Output image of the same size and datatype as src.
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
Python prototype (for reference only):
correctImage(src[, dst[, islinear]]) -> dst
@spec correctImage(t(), Evision.Mat.maybe_mat_in(), [{:islinear, term()}] | nil) :: Evision.Mat.t() | {:error, String.t()}
Applies color correction to the input image using a fitted color correction matrix.
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()src:
Evision.Mat.Input 8-bit, 16-bit unsigned or 32-bit float 3-channel image..
Keyword Arguments
islinear:
bool.default false.
Return
dst:
Evision.Mat.t().Output image of the same size and datatype as src.
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
Python prototype (for reference only):
correctImage(src[, dst[, islinear]]) -> dst
@spec getColorCorrectionMatrix(Keyword.t()) :: any() | {:error, String.t()}
@spec getColorCorrectionMatrix(t()) :: Evision.Mat.t() | {:error, String.t()}
getColorCorrectionMatrix
Positional Arguments
- self:
Evision.CCM.ColorCorrectionModel.t()
Return
- retval:
Evision.Mat.t()
Python prototype (for reference only):
getColorCorrectionMatrix() -> retval
@spec getLoss(Keyword.t()) :: any() | {:error, String.t()}
@spec getLoss(t()) :: number() | {:error, String.t()}
getLoss
Positional Arguments
- self:
Evision.CCM.ColorCorrectionModel.t()
Return
- retval:
double
Python prototype (for reference only):
getLoss() -> retval
@spec getMask(Keyword.t()) :: any() | {:error, String.t()}
@spec getMask(t()) :: Evision.Mat.t() | {:error, String.t()}
getMask
Positional Arguments
- self:
Evision.CCM.ColorCorrectionModel.t()
Return
- retval:
Evision.Mat.t()
Python prototype (for reference only):
getMask() -> retval
@spec getRefLinearRGB(Keyword.t()) :: any() | {:error, String.t()}
@spec getRefLinearRGB(t()) :: Evision.Mat.t() | {:error, String.t()}
getRefLinearRGB
Positional Arguments
- self:
Evision.CCM.ColorCorrectionModel.t()
Return
- retval:
Evision.Mat.t()
Python prototype (for reference only):
getRefLinearRGB() -> retval
@spec getSrcLinearRGB(Keyword.t()) :: any() | {:error, String.t()}
@spec getSrcLinearRGB(t()) :: Evision.Mat.t() | {:error, String.t()}
getSrcLinearRGB
Positional Arguments
- self:
Evision.CCM.ColorCorrectionModel.t()
Return
- retval:
Evision.Mat.t()
Python prototype (for reference only):
getSrcLinearRGB() -> retval
@spec getWeights(Keyword.t()) :: any() | {:error, String.t()}
@spec getWeights(t()) :: Evision.Mat.t() | {:error, String.t()}
getWeights
Positional Arguments
- self:
Evision.CCM.ColorCorrectionModel.t()
Return
- retval:
Evision.Mat.t()
Python prototype (for reference only):
getWeights() -> retval
@spec read(t(), Evision.FileNode.t()) :: t() | {:error, String.t()}
read
Positional Arguments
- self:
Evision.CCM.ColorCorrectionModel.t() - node:
Evision.FileNode
Python prototype (for reference only):
read(node) -> None
set ccmType
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()ccmType:
CcmType.the shape of color correction matrix(CCM); default: @ref CCM_LINEAR
Python prototype (for reference only):
setCcmType(ccmType) -> None
set ColorSpace
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()cs:
ColorSpace.the absolute color space that detected colors convert to; default: @ref COLOR_SPACE_SRGB
Note: It should be some RGB color space; Supported list of color cards:
- @ref COLOR_SPACE_SRGB
- @ref COLOR_SPACE_ADOBE_RGB
- @ref COLOR_SPACE_WIDE_GAMUT_RGB
- @ref COLOR_SPACE_PRO_PHOTO_RGB
- @ref COLOR_SPACE_DCI_P3_RGB
- @ref COLOR_SPACE_APPLE_RGB
- @ref COLOR_SPACE_REC_709_RGB
- @ref COLOR_SPACE_REC_2020_RGB
Python prototype (for reference only):
setColorSpace(cs) -> None
set Distance
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()distance:
DistanceType.the type of color distance; default: @ref DISTANCE_CIE2000
Python prototype (for reference only):
setDistance(distance) -> None
set Epsilon
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()epsilon:
double.used in MinProblemSolver-DownhillSolver; Terminal criteria to the algorithm; default: 1e-4;
Python prototype (for reference only):
setEpsilon(epsilon) -> None
set InitialMethod
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()initialMethodType:
InitialMethodType.the method of calculating CCM initial value; default: INITIAL_METHOD_LEAST_SQUARE
Python prototype (for reference only):
setInitialMethod(initialMethodType) -> None
set Linear
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()linearizationType:
LinearizationType.the method of linearization; default: @ref LINEARIZATION_GAMMA
Python prototype (for reference only):
setLinearization(linearizationType) -> None
set degree
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()deg:
integer().the degree of linearization polynomial default: 3
Note: only valid when linear is set to
- @ref LINEARIZATION_COLORPOLYFIT
- @ref LINEARIZATION_GRAYPOLYFIT
- @ref LINEARIZATION_COLORLOGPOLYFIT
- @ref LINEARIZATION_GRAYLOGPOLYFIT
Python prototype (for reference only):
setLinearizationDegree(deg) -> None
set Gamma
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()gamma:
double.the gamma value of gamma correction; default: 2.2;
Note: only valid when linear is set to "gamma";
Python prototype (for reference only):
setLinearizationGamma(gamma) -> None
set MaxCount
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()maxCount:
integer().used in MinProblemSolver-DownhillSolver; Terminal criteria to the algorithm; default: 5000;
Python prototype (for reference only):
setMaxCount(maxCount) -> None
Set whether the input image is in RGB color space
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()rgb:
bool.If true, the model expects input images in RGB format. If false, input is assumed to be in BGR (default).
Python prototype (for reference only):
setRGB(rgb) -> 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
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()lower:
double.the lower threshold to determine saturation; default: 0;
upper:
double.the upper threshold to determine saturation; default: 0
Python prototype (for reference only):
setSaturatedThreshold(lower, upper) -> None
set WeightCoeff
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()weightsCoeff:
double.the exponent number of L* component of the reference color in CIE Lab color space; default: 0
Python prototype (for reference only):
setWeightCoeff(weightsCoeff) -> None
@spec setWeightsList(t(), Evision.Mat.maybe_mat_in()) :: t() | {:error, String.t()}
set WeightsList
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()weightsList:
Evision.Mat.the list of weight of each color; default: empty array
Python prototype (for reference only):
setWeightsList(weightsList) -> None
@spec write(t(), Evision.FileStorage.t()) :: t() | {:error, String.t()}
write
Positional Arguments
- self:
Evision.CCM.ColorCorrectionModel.t() - fs:
Evision.FileStorage
Python prototype (for reference only):
write(fs) -> None