Trait opencv::prelude::LearningBasedWBTrait
source · pub trait LearningBasedWBTrait: LearningBasedWBTraitConst + WhiteBalancerTrait {
// Required method
fn as_raw_mut_LearningBasedWB(&mut self) -> *mut c_void;
// Provided methods
fn extract_simple_features(
&mut self,
src: &impl ToInputArray,
dst: &mut impl ToOutputArray
) -> Result<()> { ... }
fn set_range_max_val(&mut self, val: i32) -> Result<()> { ... }
fn set_saturation_threshold(&mut self, val: f32) -> Result<()> { ... }
fn set_hist_bin_num(&mut self, val: i32) -> Result<()> { ... }
}
Expand description
Mutable methods for crate::xphoto::LearningBasedWB
Required Methods§
fn as_raw_mut_LearningBasedWB(&mut self) -> *mut c_void
Provided Methods§
sourcefn extract_simple_features(
&mut self,
src: &impl ToInputArray,
dst: &mut impl ToOutputArray
) -> Result<()>
fn extract_simple_features( &mut self, src: &impl ToInputArray, dst: &mut impl ToOutputArray ) -> Result<()>
Implements the feature extraction part of the algorithm.
In accordance with Cheng2015 , computes the following features for the input image:
- Chromaticity of an average (R,G,B) tuple
- Chromaticity of the brightest (R,G,B) tuple (while ignoring saturated pixels)
- Chromaticity of the dominant (R,G,B) tuple (the one that has the highest value in the RGB histogram)
- Mode of the chromaticity palette, that is constructed by taking 300 most common colors according to the RGB histogram and projecting them on the chromaticity plane. Mode is the most high-density point of the palette, which is computed by a straightforward fixed-bandwidth kernel density estimator with a Epanechnikov kernel function.
§Parameters
- src: Input three-channel image (BGR color space is assumed).
- dst: An array of four (r,g) chromaticity tuples corresponding to the features listed above.
sourcefn set_range_max_val(&mut self, val: i32) -> Result<()>
fn set_range_max_val(&mut self, val: i32) -> Result<()>
Maximum possible value of the input image (e.g. 255 for 8 bit images, 4095 for 12 bit images)
§See also
setRangeMaxVal getRangeMaxVal
sourcefn set_saturation_threshold(&mut self, val: f32) -> Result<()>
fn set_saturation_threshold(&mut self, val: f32) -> Result<()>
Threshold that is used to determine saturated pixels, i.e. pixels where at least one of the
channels exceeds are ignored.
§See also
setSaturationThreshold getSaturationThreshold
sourcefn set_hist_bin_num(&mut self, val: i32) -> Result<()>
fn set_hist_bin_num(&mut self, val: i32) -> Result<()>
Defines the size of one dimension of a three-dimensional RGB histogram that is used internally by the algorithm. It often makes sense to increase the number of bins for images with higher bit depth (e.g. 256 bins for a 12 bit image).
§See also
setHistBinNum getHistBinNum
Object Safety§
This trait is not object safe.