Trait RetinaFastToneMappingTrait

Source
pub trait RetinaFastToneMappingTrait: AlgorithmTrait + RetinaFastToneMappingTraitConst {
    // Required method
    fn as_raw_mut_RetinaFastToneMapping(&mut self) -> *mut c_void;

    // Provided methods
    fn apply_fast_tone_mapping(
        &mut self,
        input_image: &impl ToInputArray,
        output_tone_mapped_image: &mut impl ToOutputArray,
    ) -> Result<()> { ... }
    fn setup(
        &mut self,
        photoreceptors_neighborhood_radius: f32,
        ganglioncells_neighborhood_radius: f32,
        mean_luminance_modulator_k: f32,
    ) -> Result<()> { ... }
    fn setup_def(&mut self) -> Result<()> { ... }
}
Expand description

Required Methods§

Provided Methods§

Source

fn apply_fast_tone_mapping( &mut self, input_image: &impl ToInputArray, output_tone_mapped_image: &mut impl ToOutputArray, ) -> Result<()>

applies a luminance correction (initially High Dynamic Range (HDR) tone mapping)

using only the 2 local adaptation stages of the retina parvocellular channel : photoreceptors level and ganlion cells level. Spatio temporal filtering is applied but limited to temporal smoothing and eventually high frequencies attenuation. This is a lighter method than the one available using the regular retina::run method. It is then faster but it does not include complete temporal filtering nor retina spectral whitening. Then, it can have a more limited effect on images with a very high dynamic range. This is an adptation of the original still image HDR tone mapping algorithm of David Alleyson, Sabine Susstruck and Laurence Meylan’s work, please cite: -> Meylan L., Alleysson D., and Susstrunk S., A Model of Retinal Local Adaptation for the Tone Mapping of Color Filter Array Images, Journal of Optical Society of America, A, Vol. 24, N 9, September, 1st, 2007, pp. 2807-2816

§Parameters
  • inputImage: the input image to process RGB or gray levels
  • outputToneMappedImage: the output tone mapped image
Source

fn setup( &mut self, photoreceptors_neighborhood_radius: f32, ganglioncells_neighborhood_radius: f32, mean_luminance_modulator_k: f32, ) -> Result<()>

updates tone mapping behaviors by adjusing the local luminance computation area

§Parameters
  • photoreceptorsNeighborhoodRadius: the first stage local adaptation area
  • ganglioncellsNeighborhoodRadius: the second stage local adaptation area
  • meanLuminanceModulatorK: the factor applied to modulate the meanLuminance information (default is 1, see reference paper)
§C++ default parameters
  • photoreceptors_neighborhood_radius: 3.f
  • ganglioncells_neighborhood_radius: 1.f
  • mean_luminance_modulator_k: 1.f
Source

fn setup_def(&mut self) -> Result<()>

updates tone mapping behaviors by adjusing the local luminance computation area

§Parameters
  • photoreceptorsNeighborhoodRadius: the first stage local adaptation area
  • ganglioncellsNeighborhoodRadius: the second stage local adaptation area
  • meanLuminanceModulatorK: the factor applied to modulate the meanLuminance information (default is 1, see reference paper)
§Note

This alternative version of RetinaFastToneMappingTrait::setup function uses the following default values for its arguments:

  • photoreceptors_neighborhood_radius: 3.f
  • ganglioncells_neighborhood_radius: 1.f
  • mean_luminance_modulator_k: 1.f

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§