Struct opencv::mcc::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 of course unsafe as it breaks the Rust aliasing rules, but it might 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>,

§

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>,

§

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.