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
impl ColorCorrectionModel
sourcepub fn new(
src: &impl MatTraitConst,
constcolor: CONST_COLOR
) -> Result<ColorCorrectionModel>
pub fn new( src: &impl MatTraitConst, constcolor: CONST_COLOR ) -> Result<ColorCorrectionModel>
Color Correction Model
Supported list of color cards:
- COLORCHECKER_Macbeth, the Macbeth ColorChecker
- COLORCHECKER_Vinyl, the DKK ColorChecker
- COLORCHECKER_DigitalSG, the DigitalSG ColorChecker with 140 squares
§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
sourcepub fn new_1(
src: &impl MatTraitConst,
colors: impl MatTrait,
ref_cs: COLOR_SPACE
) -> Result<ColorCorrectionModel>
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;
sourcepub fn new_2(
src: &impl MatTraitConst,
colors: impl MatTrait,
ref_cs: COLOR_SPACE,
colored: impl MatTrait
) -> Result<ColorCorrectionModel>
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
impl Boxed for ColorCorrectionModel
source§unsafe fn from_raw(
ptr: <ColorCorrectionModel as OpenCVFromExtern>::ExternReceive
) -> Self
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
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
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
fn as_raw_mut( &mut self ) -> <ColorCorrectionModel as OpenCVTypeExternContainer>::ExternSendMut
Return the underlying mutable raw pointer Read more
source§impl ColorCorrectionModelTrait for ColorCorrectionModel
impl ColorCorrectionModelTrait for ColorCorrectionModel
fn as_raw_mut_ColorCorrectionModel(&mut self) -> *mut c_void
source§fn set_color_space(&mut self, cs: COLOR_SPACE) -> Result<()>
fn set_color_space(&mut self, cs: COLOR_SPACE) -> Result<()>
set ColorSpace Read more
source§fn set_distance(&mut self, distance: DISTANCE_TYPE) -> Result<()>
fn set_distance(&mut self, distance: DISTANCE_TYPE) -> Result<()>
set Distance Read more
source§fn set_linear(&mut self, linear_type: LINEAR_TYPE) -> Result<()>
fn set_linear(&mut self, linear_type: LINEAR_TYPE) -> Result<()>
set Linear Read more
source§fn set_saturated_threshold(&mut self, lower: &f64, upper: &f64) -> Result<()>
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<()>
fn set_weights_list(&mut self, weights_list: &impl MatTraitConst) -> Result<()>
set WeightsList Read more
source§fn set_initial_method(
&mut self,
initial_method_type: INITIAL_METHOD_TYPE
) -> Result<()>
fn set_initial_method( &mut self, initial_method_type: INITIAL_METHOD_TYPE ) -> Result<()>
set InitialMethod Read more
source§impl ColorCorrectionModelTraitConst for ColorCorrectionModel
impl ColorCorrectionModelTraitConst for ColorCorrectionModel
fn as_raw_ColorCorrectionModel(&self) -> *const c_void
fn get_ccm(&self) -> Result<Mat>
fn get_loss(&self) -> Result<f64>
fn get_src_rgbl(&self) -> Result<Mat>
fn get_dst_rgbl(&self) -> Result<Mat>
fn get_mask(&self) -> Result<Mat>
fn get_weights(&self) -> Result<Mat>
source§impl Debug for ColorCorrectionModel
impl Debug for ColorCorrectionModel
source§impl Drop for ColorCorrectionModel
impl Drop for ColorCorrectionModel
impl Send for ColorCorrectionModel
Auto Trait Implementations§
impl Freeze for ColorCorrectionModel
impl RefUnwindSafe for ColorCorrectionModel
impl !Sync for ColorCorrectionModel
impl Unpin for ColorCorrectionModel
impl UnwindSafe for ColorCorrectionModel
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res
) -> Res
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