[][src]Trait opencv::xphoto::GrayworldWB

pub trait GrayworldWB: WhiteBalancer {
    fn as_raw_GrayworldWB(&self) -> *mut c_void;

    fn get_saturation_threshold(&self) -> Result<f32> { ... }
fn set_saturation_threshold(&mut self, val: f32) -> Result<()> { ... } }

Gray-world white balance algorithm

This algorithm scales the values of pixels based on a gray-world assumption which states that the average of all channels should result in a gray image.

It adds a modification which thresholds pixels based on their saturation value and only uses pixels below the provided threshold in finding average pixel values.

Saturation is calculated using the following for a 3-channel RGB image per pixel I and is in the range [0, 1]:

block formula

A threshold of 1 means that all pixels are used to white-balance, while a threshold of 0 means no pixels are used. Lower thresholds are useful in white-balancing saturated images.

Currently supports images of type @ref CV_8UC3 and @ref CV_16UC3.

Required methods

Loading content...

Provided methods

fn get_saturation_threshold(&self) -> Result<f32>

Maximum saturation for a pixel to be included in the gray-world assumption @see setSaturationThreshold

fn set_saturation_threshold(&mut self, val: f32) -> Result<()>

@copybrief getSaturationThreshold @see getSaturationThreshold

Loading content...

Implementors

Loading content...