Struct Retina

Source
pub struct Retina { /* private fields */ }
Expand description

class which allows the Gipsa/Listic Labs model to be used with OpenCV.

This retina model allows spatio-temporal image processing (applied on still images, video sequences). As a summary, these are the retina model properties:

  • It applies a spectral whithening (mid-frequency details enhancement)
  • high frequency spatio-temporal noise reduction
  • low frequency luminance to be reduced (luminance range compression)
  • local logarithmic luminance compression allows details to be enhanced in low light conditions

USE : this model can be used basically for spatio-temporal video effects but also for : _using the getParvo method output matrix : texture analysiswith enhanced signal to noise ratio and enhanced details robust against input images luminance ranges _using the getMagno method output matrix : motion analysis also with the previously cited properties

for more information, reer to the following papers : Benoit A., Caplier A., Durette B., Herault, J., “USING HUMAN VISUAL SYSTEM MODELING FOR BIO-INSPIRED LOW LEVEL IMAGE PROCESSING”, Elsevier, Computer Vision and Image Understanding 114 (2010), pp. 758-773, DOI: http://dx.doi.org/10.1016/j.cviu.2010.01.011 Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891.

The retina filter includes the research contributions of phd/research collegues from which code has been redrawn by the author : take a look at the retinacolor.hpp module to discover Brice Chaix de Lavarene color mosaicing/demosaicing and the reference paper: B. Chaix de Lavarene, D. Alleysson, B. Durette, J. Herault (2007). “Efficient demosaicing through recursive filtering”, IEEE International Conference on Image Processing ICIP 2007 take a look at imagelogpolprojection.hpp to discover retina spatial log sampling which originates from Barthelemy Durette phd with Jeanny Herault. A Retina / V1 cortex projection is also proposed and originates from Jeanny’s discussions. more informations in the above cited Jeanny Heraults’s book.

Implementations§

Source§

impl Retina

Source

pub fn create(input_size: Size) -> Result<Ptr<Retina>>

Constructors from standardized interfaces : retreive a smart pointer to a Retina instance

§Parameters
  • inputSize: the input frame size
  • colorMode: the chosen processing mode : with or without color processing
  • colorSamplingMethod: specifies which kind of color sampling will be used :
  • cv::bioinspired::RETINA_COLOR_RANDOM: each pixel position is either R, G or B in a random choice
  • cv::bioinspired::RETINA_COLOR_DIAGONAL: color sampling is RGBRGBRGB…, line 2 BRGBRGBRG…, line 3, GBRGBRGBR…
  • cv::bioinspired::RETINA_COLOR_BAYER: standard bayer sampling
  • useRetinaLogSampling: activate retina log sampling, if true, the 2 following parameters can be used
  • reductionFactor: only usefull if param useRetinaLogSampling=true, specifies the reduction factor of the output frame (as the center (fovea) is high resolution and corners can be underscaled, then a reduction of the output is allowed without precision leak
  • samplingStrength: only usefull if param useRetinaLogSampling=true, specifies the strength of the log scale that is applied
§Overloaded parameters
Source

pub fn create_ext( input_size: Size, color_mode: bool, color_sampling_method: i32, use_retina_log_sampling: bool, reduction_factor: f32, sampling_strength: f32, ) -> Result<Ptr<Retina>>

Constructors from standardized interfaces : retreive a smart pointer to a Retina instance

§Parameters
  • inputSize: the input frame size
  • colorMode: the chosen processing mode : with or without color processing
  • colorSamplingMethod: specifies which kind of color sampling will be used :
  • cv::bioinspired::RETINA_COLOR_RANDOM: each pixel position is either R, G or B in a random choice
  • cv::bioinspired::RETINA_COLOR_DIAGONAL: color sampling is RGBRGBRGB…, line 2 BRGBRGBRG…, line 3, GBRGBRGBR…
  • cv::bioinspired::RETINA_COLOR_BAYER: standard bayer sampling
  • useRetinaLogSampling: activate retina log sampling, if true, the 2 following parameters can be used
  • reductionFactor: only usefull if param useRetinaLogSampling=true, specifies the reduction factor of the output frame (as the center (fovea) is high resolution and corners can be underscaled, then a reduction of the output is allowed without precision leak
  • samplingStrength: only usefull if param useRetinaLogSampling=true, specifies the strength of the log scale that is applied
§C++ default parameters
  • color_sampling_method: RETINA_COLOR_BAYER
  • use_retina_log_sampling: false
  • reduction_factor: 1.0f
  • sampling_strength: 10.0f
Source

pub fn create_ext_def(input_size: Size, color_mode: bool) -> Result<Ptr<Retina>>

Constructors from standardized interfaces : retreive a smart pointer to a Retina instance

§Parameters
  • inputSize: the input frame size
  • colorMode: the chosen processing mode : with or without color processing
  • colorSamplingMethod: specifies which kind of color sampling will be used :
  • cv::bioinspired::RETINA_COLOR_RANDOM: each pixel position is either R, G or B in a random choice
  • cv::bioinspired::RETINA_COLOR_DIAGONAL: color sampling is RGBRGBRGB…, line 2 BRGBRGBRG…, line 3, GBRGBRGBR…
  • cv::bioinspired::RETINA_COLOR_BAYER: standard bayer sampling
  • useRetinaLogSampling: activate retina log sampling, if true, the 2 following parameters can be used
  • reductionFactor: only usefull if param useRetinaLogSampling=true, specifies the reduction factor of the output frame (as the center (fovea) is high resolution and corners can be underscaled, then a reduction of the output is allowed without precision leak
  • samplingStrength: only usefull if param useRetinaLogSampling=true, specifies the strength of the log scale that is applied
§Note

This alternative version of Retina::create_ext function uses the following default values for its arguments:

  • color_sampling_method: RETINA_COLOR_BAYER
  • use_retina_log_sampling: false
  • reduction_factor: 1.0f
  • sampling_strength: 10.0f

Trait Implementations§

Source§

impl AlgorithmTrait for Retina

Source§

fn as_raw_mut_Algorithm(&mut self) -> *mut c_void

Source§

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

Clears the algorithm state
Source§

fn read(&mut self, fn_: &impl FileNodeTraitConst) -> Result<()>

Reads algorithm parameters from a file storage
Source§

impl AlgorithmTraitConst for Retina

Source§

fn as_raw_Algorithm(&self) -> *const c_void

Source§

fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>

Stores algorithm parameters in a file storage
Source§

fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>

Stores algorithm parameters in a file storage Read more
Source§

fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>

@deprecated Read more
Source§

fn write_with_name_def(&self, fs: &Ptr<FileStorage>) -> Result<()>

👎Deprecated:

§Note

Deprecated: ## Note This alternative version of AlgorithmTraitConst::write_with_name function uses the following default values for its arguments: Read more
Source§

fn empty(&self) -> Result<bool>

Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
Source§

fn save(&self, filename: &str) -> Result<()>

Saves the algorithm to a file. In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs).
Source§

fn get_default_name(&self) -> Result<String>

Returns the algorithm string identifier. This string is used as top level xml/yml node tag when the object is saved to a file or string.
Source§

impl Boxed for Retina

Source§

unsafe fn from_raw(ptr: <Retina as OpenCVFromExtern>::ExternReceive) -> Self

Wrap the specified raw pointer Read more
Source§

fn into_raw(self) -> <Retina as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying raw pointer while consuming this wrapper. Read more
Source§

fn as_raw(&self) -> <Retina as OpenCVTypeExternContainer>::ExternSend

Return the underlying raw pointer. Read more
Source§

fn as_raw_mut(&mut self) -> <Retina as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying mutable raw pointer Read more
Source§

impl Debug for Retina

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Retina

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<Retina> for Algorithm

Source§

fn from(s: Retina) -> Self

Converts to this type from the input type.
Source§

impl RetinaTrait for Retina

Source§

fn as_raw_mut_Retina(&mut self) -> *mut c_void

Source§

fn get_input_size(&mut self) -> Result<Size>

Retreive retina input buffer size Read more
Source§

fn get_output_size(&mut self) -> Result<Size>

Retreive retina output buffer size that can be different from the input if a spatial log transformation is applied Read more
Source§

fn setup_from_file( &mut self, retina_parameter_file: &str, apply_default_setup_on_failure: bool, ) -> Result<()>

Try to open an XML retina parameters file to adjust current retina instance setup Read more
Source§

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

Try to open an XML retina parameters file to adjust current retina instance setup Read more
Source§

fn setup_from_storage( &mut self, fs: &mut impl FileStorageTrait, apply_default_setup_on_failure: bool, ) -> Result<()>

Try to open an XML retina parameters file to adjust current retina instance setup Read more
Source§

fn setup_from_storage_def( &mut self, fs: &mut impl FileStorageTrait, ) -> Result<()>

@overload Read more
Source§

fn setup(&mut self, new_parameters: impl RetinaParametersTrait) -> Result<()>

Try to open an XML retina parameters file to adjust current retina instance setup Read more
Source§

fn get_parameters(&mut self) -> Result<RetinaParameters>

Returns Read more
Source§

fn print_setup(&mut self) -> Result<String>

Outputs a string showing the used parameters setup Read more
Source§

fn setup_op_land_ipl_parvo_channel( &mut self, color_mode: bool, normalise_output: bool, photoreceptors_local_adaptation_sensitivity: f32, photoreceptors_temporal_constant: f32, photoreceptors_spatial_constant: f32, horizontal_cells_gain: f32, hcells_temporal_constant: f32, hcells_spatial_constant: f32, ganglion_cells_sensitivity: f32, ) -> Result<()>

Setup the OPL and IPL parvo channels (see biologocal model) Read more
Source§

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

Setup the OPL and IPL parvo channels (see biologocal model) Read more
Source§

fn setup_ipl_magno_channel( &mut self, normalise_output: bool, parasol_cells_beta: f32, parasol_cells_tau: f32, parasol_cells_k: f32, amacrin_cells_temporal_cut_frequency: f32, v0_compression_parameter: f32, local_adaptintegration_tau: f32, local_adaptintegration_k: f32, ) -> Result<()>

Set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel Read more
Source§

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

Set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel Read more
Source§

fn run(&mut self, input_image: &impl ToInputArray) -> Result<()>

Method which allows retina to be applied on an input image, Read more
Source§

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

Method which processes an image in the aim to correct its luminance correct backlight problems, enhance details in shadows. Read more
Source§

fn get_parvo( &mut self, retina_output_parvo: &mut impl ToOutputArray, ) -> Result<()>

Accessor of the details channel of the retina (models foveal vision). Read more
Source§

fn get_parvo_raw_to( &mut self, retina_output_parvo: &mut impl ToOutputArray, ) -> Result<()>

Accessor of the details channel of the retina (models foveal vision). Read more
Source§

fn get_magno( &mut self, retina_output_magno: &mut impl ToOutputArray, ) -> Result<()>

Accessor of the motion channel of the retina (models peripheral vision). Read more
Source§

fn get_magno_raw_to( &mut self, retina_output_magno: &mut impl ToOutputArray, ) -> Result<()>

Accessor of the motion channel of the retina (models peripheral vision). Read more
Source§

fn set_color_saturation( &mut self, saturate_colors: bool, color_saturation_value: f32, ) -> Result<()>

Activate color saturation as the final step of the color demultiplexing process -> this saturation is a sigmoide function applied to each channel of the demultiplexed image. Read more
Source§

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

Activate color saturation as the final step of the color demultiplexing process -> this saturation is a sigmoide function applied to each channel of the demultiplexed image. Read more
Source§

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

Clears all retina buffers Read more
Source§

fn activate_moving_contours_processing(&mut self, activate: bool) -> Result<()>

Activate/desactivate the Magnocellular pathway processing (motion information extraction), by default, it is activated Read more
Source§

fn activate_contours_processing(&mut self, activate: bool) -> Result<()>

Activate/desactivate the Parvocellular pathway processing (contours information extraction), by default, it is activated Read more
Source§

impl RetinaTraitConst for Retina

Source§

fn as_raw_Retina(&self) -> *const c_void

Source§

fn write(&self, fs: &str) -> Result<()>

Write xml/yml formated parameters information Read more
Source§

fn write_to_storage(&self, fs: &mut impl FileStorageTrait) -> Result<()>

Write xml/yml formated parameters information Read more
Source§

fn get_magno_raw(&self) -> Result<Mat>

Accessor of the motion channel of the retina (models peripheral vision). Read more
Source§

fn get_parvo_raw(&self) -> Result<Mat>

Accessor of the details channel of the retina (models foveal vision). Read more
Source§

impl Send for Retina

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 unsafe in a general case as it leads to having non-exclusive mutable access to the internal data, but it can 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>,

Source§

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

Source§

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.