View Source Evision.CCM.ColorCorrectionModel (Evision v0.2.9)
Summary
Functions
Color Correction Model
Color Correction Model
Color Correction Model
get_dst_rgbl
get_src_rgbl
getCCM
getLoss
getMask
getWeights
Infer using fitting ccm.
Infer using fitting ccm.
make color correction
set ccm_type
set ColorSpace
set Distance
set Epsilon
set InitialMethod
set Linear
set degree
set Gamma
set MaxCount
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
Types
@type t() :: %Evision.CCM.ColorCorrectionModel{ref: reference()}
Type that represents an CCM.ColorCorrectionModel
struct.
ref.
reference()
The underlying erlang resource variable.
Functions
@spec colorCorrectionModel(Evision.Mat.maybe_mat_in(), Evision.CCM.CONST_COLOR.enum()) :: t() | {:error, String.t()}
Color Correction Model
Positional Arguments
src:
Evision.Mat
.detected colors of ColorChecker patches;\n the color type is RGB not BGR, and the color values are in [0, 1];
constcolor:
CONST_COLOR
.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_DigitalSG, 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.COLOR_SPACE.enum() ) :: t() | {:error, String.t()}
Color Correction Model
Positional Arguments
src:
Evision.Mat
.detected colors of ColorChecker patches;\n 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].\n
ref_cs:
COLOR_SPACE
.the corresponding color space If the color type is some RGB, the format is RGB not BGR;\n
Return
- self:
ColorCorrectionModel
Python prototype (for reference only):
ColorCorrectionModel(src, colors, ref_cs) -> <ccm_ColorCorrectionModel object>
@spec colorCorrectionModel( Evision.Mat.maybe_mat_in(), Evision.Mat.maybe_mat_in(), Evision.CCM.COLOR_SPACE.enum(), Evision.Mat.maybe_mat_in() ) :: t() | {:error, String.t()}
Color Correction Model
Positional Arguments
src:
Evision.Mat
.detected colors of ColorChecker patches;\n 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].
ref_cs:
COLOR_SPACE
.the corresponding color space If the color type is some RGB, the format is RGB not BGR;
colored:
Evision.Mat
.mask of colored color
Return
- self:
ColorCorrectionModel
Python prototype (for reference only):
ColorCorrectionModel(src, colors, ref_cs, colored) -> <ccm_ColorCorrectionModel object>
@spec get_dst_rgbl(Keyword.t()) :: any() | {:error, String.t()}
@spec get_dst_rgbl(t()) :: Evision.Mat.t() | {:error, String.t()}
get_dst_rgbl
Positional Arguments
- self:
Evision.CCM.ColorCorrectionModel.t()
Return
- retval:
Evision.Mat.t()
Python prototype (for reference only):
get_dst_rgbl() -> retval
@spec get_src_rgbl(Keyword.t()) :: any() | {:error, String.t()}
@spec get_src_rgbl(t()) :: Evision.Mat.t() | {:error, String.t()}
get_src_rgbl
Positional Arguments
- self:
Evision.CCM.ColorCorrectionModel.t()
Return
- retval:
Evision.Mat.t()
Python prototype (for reference only):
get_src_rgbl() -> retval
@spec getCCM(Keyword.t()) :: any() | {:error, String.t()}
@spec getCCM(t()) :: Evision.Mat.t() | {:error, String.t()}
getCCM
Positional Arguments
- self:
Evision.CCM.ColorCorrectionModel.t()
Return
- retval:
Evision.Mat.t()
Python prototype (for reference only):
getCCM() -> 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 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 infer(t(), Evision.Mat.maybe_mat_in()) :: Evision.Mat.t() | {:error, String.t()}
Infer using fitting ccm.
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()
img:
Evision.Mat
.the input image.
Keyword Arguments
islinear:
bool
.default false.
Return
- retval:
Evision.Mat.t()
@return the output array.
Python prototype (for reference only):
infer(img[, islinear]) -> retval
@spec infer(t(), Evision.Mat.maybe_mat_in(), [{:islinear, term()}] | nil) :: Evision.Mat.t() | {:error, String.t()}
Infer using fitting ccm.
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()
img:
Evision.Mat
.the input image.
Keyword Arguments
islinear:
bool
.default false.
Return
- retval:
Evision.Mat.t()
@return the output array.
Python prototype (for reference only):
infer(img[, islinear]) -> retval
make color correction
Positional Arguments
- self:
Evision.CCM.ColorCorrectionModel.t()
Python prototype (for reference only):
run() -> None
@spec setCCM_TYPE(t(), Evision.CCM.CCM_TYPE.enum()) :: t() | {:error, String.t()}
set ccm_type
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()
ccm_type:
CCM_TYPE
.the shape of color correction matrix(CCM);\n default: @ref CCM_3x3
Python prototype (for reference only):
setCCM_TYPE(ccm_type) -> None
@spec setColorSpace(t(), Evision.CCM.COLOR_SPACE.enum()) :: t() | {:error, String.t()}
set ColorSpace
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()
cs:
COLOR_SPACE
.the absolute color space that detected colors convert to;\n 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_AdobeRGB
- @ref COLOR_SPACE_WideGamutRGB
- @ref COLOR_SPACE_ProPhotoRGB
- @ref COLOR_SPACE_DCI_P3_RGB
- @ref COLOR_SPACE_AppleRGB
- @ref COLOR_SPACE_REC_709_RGB
- @ref COLOR_SPACE_REC_2020_RGB
Python prototype (for reference only):
setColorSpace(cs) -> None
@spec setDistance(t(), Evision.CCM.DISTANCE_TYPE.enum()) :: t() | {:error, String.t()}
set Distance
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()
distance:
DISTANCE_TYPE
.the type of color distance;\n 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;\n Terminal criteria to the algorithm;\n default: 1e-4;
Python prototype (for reference only):
setEpsilon(epsilon) -> None
@spec setInitialMethod(t(), Evision.CCM.INITIAL_METHOD_TYPE.enum()) :: t() | {:error, String.t()}
set InitialMethod
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()
initial_method_type:
INITIAL_METHOD_TYPE
.the method of calculating CCM initial value;\n default: INITIAL_METHOD_LEAST_SQUARE
Python prototype (for reference only):
setInitialMethod(initial_method_type) -> None
@spec setLinear(t(), Evision.CCM.LINEAR_TYPE.enum()) :: t() | {:error, String.t()}
set Linear
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()
linear_type:
LINEAR_TYPE
.the method of linearization;\n default: @ref LINEARIZATION_GAMMA
Python prototype (for reference only):
setLinear(linear_type) -> None
set degree
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()
deg:
integer()
.the degree of linearization polynomial;\n 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):
setLinearDegree(deg) -> None
set Gamma
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()
gamma:
double
.the gamma value of gamma correction;\n default: 2.2;
Note: only valid when linear is set to "gamma";\n
Python prototype (for reference only):
setLinearGamma(gamma) -> None
set MaxCount
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()
max_count:
integer()
.used in MinProblemSolver-DownhillSolver;\n Terminal criteria to the algorithm;\n default: 5000;
Python prototype (for reference only):
setMaxCount(max_count) -> 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;\n default: 0;
upper:
double
.the upper threshold to determine saturation;\n default: 0
Python prototype (for reference only):
setSaturatedThreshold(lower, upper) -> None
set WeightCoeff
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()
weights_coeff:
double
.the exponent number of L* component of the reference color in CIE Lab color space;\n default: 0
Python prototype (for reference only):
setWeightCoeff(weights_coeff) -> None
@spec setWeightsList(t(), Evision.Mat.maybe_mat_in()) :: t() | {:error, String.t()}
set WeightsList
Positional Arguments
self:
Evision.CCM.ColorCorrectionModel.t()
weights_list:
Evision.Mat
.the list of weight of each color;\n default: empty array
Python prototype (for reference only):
setWeightsList(weights_list) -> None