Struct ColorCorrectionModel

Source
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: &impl MatTraitConst, 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: &impl MatTraitConst, colors: impl MatTrait, 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: &impl MatTraitConst, colors: impl MatTrait, ref_cs: COLOR_SPACE, colored: impl MatTrait, ) -> 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: <ColorCorrectionModel as OpenCVFromExtern>::ExternReceive, ) -> Self

Wrap the specified raw pointer Read more
Source§

fn into_raw( self, ) -> <ColorCorrectionModel as OpenCVTypeExternContainer>::ExternSendMut

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

fn as_raw( &self, ) -> <ColorCorrectionModel as OpenCVTypeExternContainer>::ExternSend

Return the underlying raw pointer. Read more
Source§

fn as_raw_mut( &mut self, ) -> <ColorCorrectionModel as OpenCVTypeExternContainer>::ExternSendMut

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: &impl MatTraitConst) -> 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: &impl MatTraitConst, islinear: bool) -> Result<Mat>

Infer using fitting ccm. Read more
Source§

fn infer_def(&mut self, img: &impl MatTraitConst) -> 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 T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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<Mat> ModifyInplace for Mat
where Mat: Boxed,

Source§

unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res

Helper function to call OpenCV functions that allow in-place modification of a Mat or another similar object. By passing a mutable reference to the Mat to this function your closure will get called with the read reference and a write references to the same Mat. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data, but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.