pub struct ColorCorrectionModel { /* private fields */ }
Expand description

Core class of ccm model

Produce a ColorCorrectionModel instance for inference

Implementations§

source§

impl ColorCorrectionModel

source

pub fn new(src: &Mat, constcolor: CONST_COLOR) -> Result<ColorCorrectionModel>

Color Correction Model

Supported list of color cards:

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

source

pub fn new_1( src: &Mat, colors: Mat, ref_cs: COLOR_SPACE ) -> Result<ColorCorrectionModel>

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].

  • ref_cs: the corresponding color space If the color type is some RGB, the format is RGB not BGR;

source

pub fn new_2( src: &Mat, colors: Mat, ref_cs: COLOR_SPACE, colored: Mat ) -> Result<ColorCorrectionModel>

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].

  • ref_cs: the corresponding color space If the color type is some RGB, the format is RGB not BGR;

  • colored: mask of colored color

Trait Implementations§

source§

impl Boxed for ColorCorrectionModel

source§

unsafe fn from_raw(ptr: *mut c_void) -> Self

Wrap the specified raw pointer Read more
source§

fn into_raw(self) -> *mut c_void

Return an the underlying raw pointer while consuming this wrapper. Read more
source§

fn as_raw(&self) -> *const c_void

Return the underlying raw pointer. Read more
source§

fn as_raw_mut(&mut self) -> *mut c_void

Return the underlying mutable raw pointer Read more
source§

impl ColorCorrectionModelTrait for ColorCorrectionModel

source§

fn as_raw_mut_ColorCorrectionModel(&mut self) -> *mut c_void

source§

fn set_color_space(&mut self, cs: COLOR_SPACE) -> Result<()>

set ColorSpace Read more
source§

fn set_ccm_type(&mut self, ccm_type: CCM_TYPE) -> Result<()>

set ccm_type Read more
source§

fn set_distance(&mut self, distance: DISTANCE_TYPE) -> Result<()>

set Distance Read more
source§

fn set_linear(&mut self, linear_type: LINEAR_TYPE) -> Result<()>

set Linear Read more
source§

fn set_linear_gamma(&mut self, gamma: &f64) -> Result<()>

set Gamma Read more
source§

fn set_linear_degree(&mut self, deg: &i32) -> Result<()>

set degree Read more
source§

fn set_saturated_threshold(&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 Read more
source§

fn set_weights_list(&mut self, weights_list: &Mat) -> Result<()>

set WeightsList Read more
source§

fn set_weight_coeff(&mut self, weights_coeff: &f64) -> Result<()>

set WeightCoeff Read more
source§

fn set_initial_method( &mut self, initial_method_type: INITIAL_METHOD_TYPE ) -> Result<()>

set InitialMethod Read more
source§

fn set_max_count(&mut self, max_count: &i32) -> Result<()>

set MaxCount Read more
source§

fn set_epsilon(&mut self, epsilon: &f64) -> Result<()>

set Epsilon Read more
source§

fn run(&mut self) -> Result<()>

make color correction
source§

fn infer(&mut self, img: &Mat, islinear: bool) -> Result<Mat>

Infer using fitting ccm. Read more
source§

impl ColorCorrectionModelTraitConst for ColorCorrectionModel

source§

impl Debug for ColorCorrectionModel

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for ColorCorrectionModel

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Send for ColorCorrectionModel

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.