OpenCV  3.0.0-rc1
Open Source Computer Vision
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Member Functions | List of all members
cv::bioinspired::Retina Class Referenceabstract

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

#include "retina.hpp"

Inheritance diagram for cv::bioinspired::Retina:
cv::Algorithm

Classes

struct  RetinaParameters
 parameters structure More...
 

Public Member Functions

virtual void activateContoursProcessing (const bool activate)=0
 Activate/desactivate the Parvocellular pathway processing (contours information extraction), by default, it is activated. More...
 
virtual void activateMovingContoursProcessing (const bool activate)=0
 Activate/desactivate the Magnocellular pathway processing (motion information extraction), by default, it is activated. More...
 
virtual void applyFastToneMapping (InputArray inputImage, OutputArray outputToneMappedImage)=0
 Method which processes an image in the aim to correct its luminance correct backlight problems, enhance details in shadows. More...
 
virtual void clearBuffers ()=0
 Clears all retina buffers. More...
 
virtual Size getInputSize ()=0
 Retreive retina input buffer size. More...
 
virtual void getMagno (OutputArray retinaOutput_magno)=0
 Accessor of the motion channel of the retina (models peripheral vision). More...
 
virtual void getMagnoRAW (OutputArray retinaOutput_magno)=0
 Accessor of the motion channel of the retina (models peripheral vision). More...
 
virtual const Mat getMagnoRAW () const =0
 
virtual Size getOutputSize ()=0
 Retreive retina output buffer size that can be different from the input if a spatial log transformation is applied. More...
 
virtual RetinaParameters getParameters ()=0
 
virtual void getParvo (OutputArray retinaOutput_parvo)=0
 Accessor of the details channel of the retina (models foveal vision). More...
 
virtual void getParvoRAW (OutputArray retinaOutput_parvo)=0
 Accessor of the details channel of the retina (models foveal vision). More...
 
virtual const Mat getParvoRAW () const =0
 
virtual const String printSetup ()=0
 Outputs a string showing the used parameters setup. More...
 
virtual void run (InputArray inputImage)=0
 Method which allows retina to be applied on an input image,. More...
 
virtual void setColorSaturation (const bool saturateColors=true, const float colorSaturationValue=4.0)=0
 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. More...
 
virtual void setup (String retinaParameterFile="", const bool applyDefaultSetupOnFailure=true)=0
 Try to open an XML retina parameters file to adjust current retina instance setup. More...
 
virtual void setup (cv::FileStorage &fs, const bool applyDefaultSetupOnFailure=true)=0
 
virtual void setup (RetinaParameters newParameters)=0
 
virtual void setupIPLMagnoChannel (const bool normaliseOutput=true, const float parasolCells_beta=0, const float parasolCells_tau=0, const float parasolCells_k=7, const float amacrinCellsTemporalCutFrequency=1.2, const float V0CompressionParameter=0.95, const float localAdaptintegration_tau=0, const float localAdaptintegration_k=7)=0
 Set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel. More...
 
virtual void setupOPLandIPLParvoChannel (const bool colorMode=true, const bool normaliseOutput=true, const float photoreceptorsLocalAdaptationSensitivity=0.7, const float photoreceptorsTemporalConstant=0.5, const float photoreceptorsSpatialConstant=0.53, const float horizontalCellsGain=0, const float HcellsTemporalConstant=1, const float HcellsSpatialConstant=7, const float ganglionCellsSensitivity=0.7)=0
 Setup the OPL and IPL parvo channels (see biologocal model) More...
 
virtual void write (String fs) const =0
 Write xml/yml formated parameters information. More...
 
virtual void write (FileStorage &fs) const =0
 
- Public Member Functions inherited from cv::Algorithm
 Algorithm ()
 
virtual ~Algorithm ()
 
virtual void clear ()
 Clears the algorithm state. More...
 
virtual bool empty () const
 Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. More...
 
virtual String getDefaultName () const
 
virtual void read (const FileNode &fn)
 Reads algorithm parameters from a file storage. More...
 
virtual void save (const String &filename) const
 

Related Functions

(Note that these are not member functions.)

Ptr< RetinacreateRetina (Size inputSize)
 
Ptr< RetinacreateRetina (Size inputSize, const bool colorMode, int colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrenght=10.0)
 Constructors from standardized interfaces : retreive a smart pointer to a Retina instance. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from cv::Algorithm
template<typename _Tp >
static Ptr< _Tp > load (const String &filename, const String &objname=String())
 Loads algorithm from the file. More...
 
template<typename _Tp >
static Ptr< _Tp > loadFromString (const String &strModel, const String &objname=String())
 Loads algorithm from a String. More...
 
template<typename _Tp >
static Ptr< _Tp > read (const FileNode &fn)
 Reads algorithm from the file node. More...
 

Detailed 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:

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.

Member Function Documentation

virtual void cv::bioinspired::Retina::activateContoursProcessing ( const bool  activate)
pure virtual

Activate/desactivate the Parvocellular pathway processing (contours information extraction), by default, it is activated.

Parameters
activatetrue if Parvocellular (contours information extraction) output should be activated, false if not... if activated, the Parvocellular output can be retrieved using the Retina::getParvo methods
virtual void cv::bioinspired::Retina::activateMovingContoursProcessing ( const bool  activate)
pure virtual

Activate/desactivate the Magnocellular pathway processing (motion information extraction), by default, it is activated.

Parameters
activatetrue if Magnocellular output should be activated, false if not... if activated, the Magnocellular output can be retrieved using the getMagno methods
virtual void cv::bioinspired::Retina::applyFastToneMapping ( InputArray  inputImage,
OutputArray  outputToneMappedImage 
)
pure virtual

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

This method is designed to perform High Dynamic Range image tone mapping (compress >8bit/pixel images to 8bit/pixel). This is a simplified version of the Retina Parvocellular model (simplified version of the run/getParvo methods call) since it does not include the spatio-temporal filter modelling the Outer Plexiform Layer of the retina that performs spectral whitening and many other stuff. However, it works great for tone mapping and in a faster way.

Check the demos and experiments section to see examples and the way to perform tone mapping using the original retina model and the method.

Parameters
inputImagethe input image to process (should be coded in float format : CV_32F, CV_32FC1, CV_32F_C3, CV_32F_C4, the 4th channel won't be considered).
outputToneMappedImagethe output 8bit/channel tone mapped image (CV_8U or CV_8UC3 format).
virtual void cv::bioinspired::Retina::clearBuffers ( )
pure virtual

Clears all retina buffers.

(equivalent to opening the eyes after a long period of eye close ;o) whatchout the temporal transition occuring just after this method call.

virtual Size cv::bioinspired::Retina::getInputSize ( )
pure virtual

Retreive retina input buffer size.

Returns
the retina input buffer size
virtual void cv::bioinspired::Retina::getMagno ( OutputArray  retinaOutput_magno)
pure virtual

Accessor of the motion channel of the retina (models peripheral vision).

Warning, getMagnoRAW methods return buffers that are not rescaled within range [0;255] while the non RAW method allows a normalized matrix to be retrieved.

Parameters
retinaOutput_magnothe output buffer (reallocated if necessary), format can be :
  • a Mat, this output is rescaled for standard 8bits image processing use in OpenCV
  • RAW methods actually return a 1D matrix (encoding is M1, M2,... Mn), this output is the original retina filter model output, without any quantification or rescaling.
See also
getMagnoRAW
virtual void cv::bioinspired::Retina::getMagnoRAW ( OutputArray  retinaOutput_magno)
pure virtual

Accessor of the motion channel of the retina (models peripheral vision).

See also
getMagno
virtual const Mat cv::bioinspired::Retina::getMagnoRAW ( ) const
pure virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

virtual Size cv::bioinspired::Retina::getOutputSize ( )
pure virtual

Retreive retina output buffer size that can be different from the input if a spatial log transformation is applied.

Returns
the retina output buffer size
virtual RetinaParameters cv::bioinspired::Retina::getParameters ( )
pure virtual
Returns
the current parameters setup
virtual void cv::bioinspired::Retina::getParvo ( OutputArray  retinaOutput_parvo)
pure virtual

Accessor of the details channel of the retina (models foveal vision).

Warning, getParvoRAW methods return buffers that are not rescaled within range [0;255] while the non RAW method allows a normalized matrix to be retrieved.

Parameters
retinaOutput_parvothe output buffer (reallocated if necessary), format can be :
  • a Mat, this output is rescaled for standard 8bits image processing use in OpenCV
  • RAW methods actually return a 1D matrix (encoding is R1, R2, ... Rn, G1, G2, ..., Gn, B1, B2, ...Bn), this output is the original retina filter model output, without any quantification or rescaling.
See also
getParvoRAW
virtual void cv::bioinspired::Retina::getParvoRAW ( OutputArray  retinaOutput_parvo)
pure virtual

Accessor of the details channel of the retina (models foveal vision).

See also
getParvo
virtual const Mat cv::bioinspired::Retina::getParvoRAW ( ) const
pure virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

virtual const String cv::bioinspired::Retina::printSetup ( )
pure virtual

Outputs a string showing the used parameters setup.

Returns
a string which contains formated parameters information
virtual void cv::bioinspired::Retina::run ( InputArray  inputImage)
pure virtual

Method which allows retina to be applied on an input image,.

after run, encapsulated retina module is ready to deliver its outputs using dedicated acccessors, see getParvo and getMagno methods

Parameters
inputImagethe input Mat image to be processed, can be gray level or BGR coded in any format (from 8bit to 16bits)
virtual void cv::bioinspired::Retina::setColorSaturation ( const bool  saturateColors = true,
const float  colorSaturationValue = 4.0 
)
pure virtual

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.

Parameters
saturateColorsboolean that activates color saturation (if true) or desactivate (if false)
colorSaturationValuethe saturation factor : a simple factor applied on the chrominance buffers
virtual void cv::bioinspired::Retina::setup ( String  retinaParameterFile = "",
const bool  applyDefaultSetupOnFailure = true 
)
pure virtual

Try to open an XML retina parameters file to adjust current retina instance setup.

  • if the xml file does not exist, then default setup is applied
  • warning, Exceptions are thrown if read XML file is not valid
    Parameters
    retinaParameterFilethe parameters filename
    applyDefaultSetupOnFailureset to true if an error must be thrown on error You can retreive the current parameers structure using method Retina::getParameters and update it before running method Retina::setup
virtual void cv::bioinspired::Retina::setup ( cv::FileStorage fs,
const bool  applyDefaultSetupOnFailure = true 
)
pure virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
fsthe open Filestorage which contains retina parameters
applyDefaultSetupOnFailureset to true if an error must be thrown on error
virtual void cv::bioinspired::Retina::setup ( RetinaParameters  newParameters)
pure virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
newParametersa parameters structures updated with the new target configuration.
virtual void cv::bioinspired::Retina::setupIPLMagnoChannel ( const bool  normaliseOutput = true,
const float  parasolCells_beta = 0,
const float  parasolCells_tau = 0,
const float  parasolCells_k = 7,
const float  amacrinCellsTemporalCutFrequency = 1.2,
const float  V0CompressionParameter = 0.95,
const float  localAdaptintegration_tau = 0,
const float  localAdaptintegration_k = 7 
)
pure virtual

Set parameters values for the Inner Plexiform Layer (IPL) magnocellular channel.

this channel processes signals output from OPL processing stage in peripheral vision, it allows motion information enhancement. It is decorrelated from the details channel. See reference papers for more details.

Parameters
normaliseOutputspecifies if (true) output is rescaled between 0 and 255 of not (false)
parasolCells_betathe low pass filter gain used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), typical value is 0
parasolCells_tauthe low pass filter time constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is frame, typical value is 0 (immediate response)
parasolCells_kthe low pass filter spatial constant used for local contrast adaptation at the IPL level of the retina (for ganglion cells local adaptation), unit is pixels, typical value is 5
amacrinCellsTemporalCutFrequencythe time constant of the first order high pass fiter of the magnocellular way (motion information channel), unit is frames, typical value is 1.2
V0CompressionParameterthe compression strengh of the ganglion cells local adaptation output, set a value between 0.6 and 1 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 0.95
localAdaptintegration_tauspecifies the temporal constant of the low pas filter involved in the computation of the local "motion mean" for the local adaptation computation
localAdaptintegration_kspecifies the spatial constant of the low pas filter involved in the computation of the local "motion mean" for the local adaptation computation
virtual void cv::bioinspired::Retina::setupOPLandIPLParvoChannel ( const bool  colorMode = true,
const bool  normaliseOutput = true,
const float  photoreceptorsLocalAdaptationSensitivity = 0.7,
const float  photoreceptorsTemporalConstant = 0.5,
const float  photoreceptorsSpatialConstant = 0.53,
const float  horizontalCellsGain = 0,
const float  HcellsTemporalConstant = 1,
const float  HcellsSpatialConstant = 7,
const float  ganglionCellsSensitivity = 0.7 
)
pure virtual

Setup the OPL and IPL parvo channels (see biologocal model)

setup the OPL and IPL parvo channels (see biologocal model) OPL is referred as Outer Plexiform Layer of the retina, it allows the spatio-temporal filtering which withens the spectrum and reduces spatio-temporal noise while attenuating global luminance (low frequency energy) IPL parvo is the OPL next processing stage, it refers to Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. for more informations, please have a look at the paper 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

Parameters
colorMode: specifies if (true) color is processed of not (false) to then processing gray level image
normaliseOutput: specifies if (true) output is rescaled between 0 and 255 of not (false)
photoreceptorsLocalAdaptationSensitivitythe photoreceptors sensitivity renage is 0-1 (more log compression effect when value increases)
photoreceptorsTemporalConstantthe time constant of the first order low pass filter of the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is frames, typical value is 1 frame
photoreceptorsSpatialConstantthe spatial constant of the first order low pass filter of the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is pixels, typical value is 1 pixel
horizontalCellsGaingain of the horizontal cells network, if 0, then the mean value of the output is zero, if the parameter is near 1, then, the luminance is not filtered and is still reachable at the output, typicall value is 0
HcellsTemporalConstantthe time constant of the first order low pass filter of the horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is frames, typical value is 1 frame, as the photoreceptors
HcellsSpatialConstantthe spatial constant of the first order low pass filter of the horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels, typical value is 5 pixel, this value is also used for local contrast computing when computing the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular channel model)
ganglionCellsSensitivitythe compression strengh of the ganglion cells local adaptation output, set a value between 160 and 250 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 230OPL is referred as Outer Plexiform Layer of the retina, it allows the spatio-temporal filtering which withens the spectrum and reduces spatio-temporal noise while attenuating global luminance (low frequency energy) IPL parvo is the OPL next processing stage, it refers to a part of the Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. See reference papers for more informations.
colorModespecifies if (true) color is processed of not (false) to then processing gray level image
normaliseOutputspecifies if (true) output is rescaled between 0 and 255 of not (false)
photoreceptorsLocalAdaptationSensitivitythe photoreceptors sensitivity renage is 0-1 (more log compression effect when value increases)
photoreceptorsTemporalConstantthe time constant of the first order low pass filter of the photoreceptors, use it to cut high temporal frequencies (noise or fast motion), unit is frames, typical value is 1 frame
photoreceptorsSpatialConstantthe spatial constant of the first order low pass filter of the photoreceptors, use it to cut high spatial frequencies (noise or thick contours), unit is pixels, typical value is 1 pixel
horizontalCellsGaingain of the horizontal cells network, if 0, then the mean value of the output is zero, if the parameter is near 1, then, the luminance is not filtered and is still reachable at the output, typicall value is 0
HcellsTemporalConstantthe time constant of the first order low pass filter of the horizontal cells, use it to cut low temporal frequencies (local luminance variations), unit is frames, typical value is 1 frame, as the photoreceptors
HcellsSpatialConstantthe spatial constant of the first order low pass filter of the horizontal cells, use it to cut low spatial frequencies (local luminance), unit is pixels, typical value is 5 pixel, this value is also used for local contrast computing when computing the local contrast adaptation at the ganglion cells level (Inner Plexiform Layer parvocellular channel model)
ganglionCellsSensitivitythe compression strengh of the ganglion cells local adaptation output, set a value between 0.6 and 1 for best results, a high value increases more the low value sensitivity... and the output saturates faster, recommended value: 0.7
virtual void cv::bioinspired::Retina::write ( String  fs) const
pure virtual

Write xml/yml formated parameters information.

Parameters
fsthe filename of the xml file that will be open and writen with formatted parameters information
virtual void cv::bioinspired::Retina::write ( FileStorage fs) const
pure virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Reimplemented from cv::Algorithm.


The documentation for this class was generated from the following file: