[−][src]Trait opencv::mcc::prelude::ColorCorrectionModelTrait
Core class of ccm model
Produce a ColorCorrectionModel instance for inference
Required methods
pub fn as_raw_ColorCorrectionModel(&self) -> *const c_void
[src]
pub fn as_raw_mut_ColorCorrectionModel(&mut self) -> *mut c_void
[src]
Provided methods
pub fn set_color_space(&mut self, cs: COLOR_SPACE) -> Result<()>
[src]
set ColorSpace
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
Parameters
-
cs: the absolute color space that detected colors convert to;
default: @ref COLOR_SPACE_sRGB
pub fn set_ccm_type(&mut self, ccm_type: CCM_TYPE) -> Result<()>
[src]
pub fn set_distance(&mut self, distance: DISTANCE_TYPE) -> Result<()>
[src]
pub fn set_linear(&mut self, linear_type: LINEAR_TYPE) -> Result<()>
[src]
pub fn set_linear_gamma(&mut self, gamma: &f64) -> Result<()>
[src]
set Gamma
Note: only valid when linear is set to "gamma";
Parameters
-
gamma: the gamma value of gamma correction;
default: 2.2;
pub fn set_linear_degree(&mut self, deg: &i32) -> Result<()>
[src]
set degree
Note: only valid when linear is set to
- @ref LINEARIZATION_COLORPOLYFIT
- @ref LINEARIZATION_GRAYPOLYFIT
- @ref LINEARIZATION_COLORLOGPOLYFIT
- @ref LINEARIZATION_GRAYLOGPOLYFIT
Parameters
-
deg: the degree of linearization polynomial;
default: 3
pub fn set_saturated_threshold(
&mut self,
lower: &f64,
upper: &f64
) -> Result<()>
[src]
&mut self,
lower: &f64,
upper: &f64
) -> Result<()>
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
pub fn set_weights_list(&mut self, weights_list: &Mat) -> Result<()>
[src]
pub fn set_weight_coeff(&mut self, weights_coeff: &f64) -> Result<()>
[src]
set WeightCoeff
Parameters
-
weights_coeff: the exponent number of L* component of the reference color in CIE Lab color space;
default: 0
pub fn set_initial_method(
&mut self,
initial_method_type: INITIAL_METHOD_TYPE
) -> Result<()>
[src]
&mut self,
initial_method_type: INITIAL_METHOD_TYPE
) -> Result<()>
set InitialMethod
Parameters
-
initial_method_type: the method of calculating CCM initial value;
default: INITIAL_METHOD_LEAST_SQUARE
pub fn set_max_count(&mut self, max_count: &i32) -> Result<()>
[src]
set MaxCount
Parameters
-
max_count: used in MinProblemSolver-DownhillSolver;
Terminal criteria to the algorithm;
default: 5000;
pub fn set_epsilon(&mut self, epsilon: &f64) -> Result<()>
[src]
set Epsilon
Parameters
-
epsilon: used in MinProblemSolver-DownhillSolver;
Terminal criteria to the algorithm;
default: 1e-4;
pub fn run(&mut self) -> Result<()>
[src]
make color correction
pub fn get_ccm(&self) -> Result<Mat>
[src]
pub fn get_loss(&self) -> Result<f64>
[src]
pub fn get_src_rgbl(&self) -> Result<Mat>
[src]
pub fn get_dst_rgbl(&self) -> Result<Mat>
[src]
pub fn get_mask(&self) -> Result<Mat>
[src]
pub fn get_weights(&self) -> Result<Mat>
[src]
pub fn infer(&mut self, img: &Mat, islinear: bool) -> Result<Mat>
[src]
Infer using fitting ccm.
Parameters
- img: the input image.
- islinear: default false.
Returns
the output array.
C++ default parameters
- islinear: false