Honor resently added functionality in hdr_parser and rst_parser; minor fixes in documentation

pull/31/merge
Andrey Kamaev 13 years ago
parent dc5c7ee68f
commit 0e9405e591
  1. 4
      doc/_themes/blue/static/default.css_t
  2. 4
      doc/check_docs2.py
  3. 22
      modules/contrib/doc/facerec/facerec_api.rst
  4. 92
      modules/contrib/doc/retina/index.rst
  5. 2
      modules/contrib/include/opencv2/contrib/openfabmap.hpp
  6. 34
      modules/gpu/doc/image_processing.rst
  7. 4
      modules/java/generator/rst_parser.py
  8. 14
      modules/python/src2/hdr_parser.py

@ -179,6 +179,10 @@ div.body p, div.body dd, div.body li {
margin-bottom: 1em; margin-bottom: 1em;
} }
div.toctree-wrapper li, ul.simple li {
margin:0;
}
div.body h1, div.body h1,
div.body h2, div.body h2,
div.body h3, div.body h3,

@ -31,7 +31,7 @@ doc_signatures_whitelist = [
# templates # templates
"Matx", "Vec", "SparseMat_", "Scalar_", "Mat_", "Ptr", "Size_", "Point_", "Rect_", "Point3_", "Matx", "Vec", "SparseMat_", "Scalar_", "Mat_", "Ptr", "Size_", "Point_", "Rect_", "Point3_",
"DataType", "detail::RotationWarperBase", "flann::Index_", "CalonderDescriptorExtractor", "DataType", "detail::RotationWarperBase", "flann::Index_", "CalonderDescriptorExtractor",
"gpu::DevMem2D_", "gpu::PtrStep_", "gpu::PtrElemStep_", "gpu::PtrStepSz", "gpu::PtrStep", "gpu::PtrElemStep_",
# black boxes # black boxes
"CvArr", "CvFileStorage", "CvArr", "CvFileStorage",
# other # other
@ -191,7 +191,7 @@ def process_module(module, path):
hdrlist.append(os.path.join(root, filename)) hdrlist.append(os.path.join(root, filename))
if module == "gpu": if module == "gpu":
hdrlist.append(os.path.join(path, "..", "core", "include", "opencv2", "core", "devmem2d.hpp")) hdrlist.append(os.path.join(path, "..", "core", "include", "opencv2", "core", "cuda_devptrs.hpp"))
hdrlist.append(os.path.join(path, "..", "core", "include", "opencv2", "core", "gpumat.hpp")) hdrlist.append(os.path.join(path, "..", "core", "include", "opencv2", "core", "gpumat.hpp"))
decls = [] decls = []

@ -19,19 +19,19 @@ a unified access to all face recongition algorithms in OpenCV. ::
// Trains a FaceRecognizer. // Trains a FaceRecognizer.
virtual void train(InputArray src, InputArray labels) = 0; virtual void train(InputArray src, InputArray labels) = 0;
// Updates a FaceRecognizer. // Updates a FaceRecognizer.
virtual void update(InputArrayOfArrays src, InputArray labels); virtual void update(InputArrayOfArrays src, InputArray labels);
// Gets a prediction from a FaceRecognizer. // Gets a prediction from a FaceRecognizer.
virtual int predict(InputArray src) const = 0; virtual int predict(InputArray src) const = 0;
// Predicts the label and confidence for a given sample. // Predicts the label and confidence for a given sample.
virtual void predict(InputArray src, int &label, double &confidence) const = 0; virtual void predict(InputArray src, int &label, double &confidence) const = 0;
// Serializes this object to a given filename. // Serializes this object to a given filename.
virtual void save(const string& filename) const; virtual void save(const string& filename) const;
// Deserializes this object from a given filename. // Deserializes this object from a given filename.
virtual void load(const string& filename); virtual void load(const string& filename);
@ -58,7 +58,7 @@ I'll go a bit more into detail explaining :ocv:class:`FaceRecognizer`, because i
Moreover every :ocv:class:`FaceRecognizer` supports the: Moreover every :ocv:class:`FaceRecognizer` supports the:
* **Training** of a :ocv:class:`FaceRecognizer` with :ocv:func:`FaceRecognizer::train` on a given set of images (your face database!). * **Training** of a :ocv:class:`FaceRecognizer` with :ocv:func:`FaceRecognizer::train` on a given set of images (your face database!).
* **Prediction** of a given sample image, that means a face. The image is given as a :ocv:class:`Mat`. * **Prediction** of a given sample image, that means a face. The image is given as a :ocv:class:`Mat`.
@ -111,7 +111,7 @@ Since every :ocv:class:`FaceRecognizer` is a :ocv:class:`Algorithm`, you can use
.. code-block:: cpp .. code-block:: cpp
// Create a FaceRecognizer: // Create a FaceRecognizer:
Ptr<FaceRecognizer> model = createEigenFaceRecognizer(); Ptr<FaceRecognizer> model = createEigenFaceRecognizer();
// And here's how to get its name: // And here's how to get its name:
std::string name = model->name(); std::string name = model->name();
@ -121,7 +121,7 @@ FaceRecognizer::train
Trains a FaceRecognizer with given data and associated labels. Trains a FaceRecognizer with given data and associated labels.
.. ocv:function:: void FaceRecognizer::train(InputArray src, InputArray labels) .. ocv:function:: void FaceRecognizer::train( InputArrayOfArrays src, InputArray labels ) = 0
:param src: The training images, that means the faces you want to learn. The data has to be given as a ``vector<Mat>``. :param src: The training images, that means the faces you want to learn. The data has to be given as a ``vector<Mat>``.
@ -166,7 +166,7 @@ FaceRecognizer::update
Updates a FaceRecognizer with given data and associated labels. Updates a FaceRecognizer with given data and associated labels.
.. ocv:function:: void FaceRecognizer::update(InputArray src, InputArray labels) .. ocv:function:: void FaceRecognizer::update( InputArrayOfArrays src, InputArray labels )
:param src: The training images, that means the faces you want to learn. The data has to be given as a ``vector<Mat>``. :param src: The training images, that means the faces you want to learn. The data has to be given as a ``vector<Mat>``.
@ -193,7 +193,7 @@ This method updates a (probably trained) :ocv:class:`FaceRecognizer`, but only i
// //
// Now updating the model is as easy as calling: // Now updating the model is as easy as calling:
model->update(newImages,newLabels); model->update(newImages,newLabels);
// This will preserve the old model data and extend the existing model // This will preserve the old model data and extend the existing model
// with the new features extracted from newImages! // with the new features extracted from newImages!
Calling update on an Eigenfaces model (see :ocv:func:`createEigenFaceRecognizer`), which doesn't support updating, will throw an error similar to: Calling update on an Eigenfaces model (see :ocv:func:`createEigenFaceRecognizer`), which doesn't support updating, will throw an error similar to:
@ -203,8 +203,8 @@ Calling update on an Eigenfaces model (see :ocv:func:`createEigenFaceRecognizer`
OpenCV Error: The function/feature is not implemented (This FaceRecognizer (FaceRecognizer.Eigenfaces) does not support updating, you have to use FaceRecognizer::train to update it.) in update, file /home/philipp/git/opencv/modules/contrib/src/facerec.cpp, line 305 OpenCV Error: The function/feature is not implemented (This FaceRecognizer (FaceRecognizer.Eigenfaces) does not support updating, you have to use FaceRecognizer::train to update it.) in update, file /home/philipp/git/opencv/modules/contrib/src/facerec.cpp, line 305
terminate called after throwing an instance of 'cv::Exception' terminate called after throwing an instance of 'cv::Exception'
Please note: The :ocv:class:`FaceRecognizer` does not store your training images, because this would be very memory intense and it's not the responsibility of te :ocv:class:`FaceRecognizer` to do so. The caller is responsible for maintaining the dataset, he want to work with. Please note: The :ocv:class:`FaceRecognizer` does not store your training images, because this would be very memory intense and it's not the responsibility of te :ocv:class:`FaceRecognizer` to do so. The caller is responsible for maintaining the dataset, he want to work with.
FaceRecognizer::predict FaceRecognizer::predict
----------------------- -----------------------

@ -14,7 +14,7 @@ Class which provides the main controls to the Gipsa/Listic labs human retina mo
* periphearal vision for sensitive transient signals detection (motion and events) : the magnocellular pathway. * periphearal vision for sensitive transient signals detection (motion and events) : the magnocellular pathway.
The retina can be settled up with various parameters, by default, the retina cancels mean luminance and enforces all details of the visual scene. In order to use your own parameters, you can use at least one time the *write(std::string fs)* method which will write a proper XML file with all default parameters. Then, tweak it on your own and reload them at any time using method *setup(std::string fs)*. These methods update a *cv::Retina::RetinaParameters* member structure that is described hereafter. :: The retina can be settled up with various parameters, by default, the retina cancels mean luminance and enforces all details of the visual scene. In order to use your own parameters, you can use at least one time the *write(std::string fs)* method which will write a proper XML file with all default parameters. Then, tweak it on your own and reload them at any time using method *setup(std::string fs)*. These methods update a *Retina::RetinaParameters* member structure that is described hereafter. ::
class Retina class Retina
{ {
@ -25,7 +25,7 @@ The retina can be settled up with various parameters, by default, the retina can
// constructors // constructors
Retina (Size inputSize); Retina (Size inputSize);
Retina (Size inputSize, const bool colorMode, RETINA_COLORSAMPLINGMETHOD colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrenght=10.0); Retina (Size inputSize, const bool colorMode, RETINA_COLORSAMPLINGMETHOD colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrenght=10.0);
// main method for input frame processing // main method for input frame processing
void run (const Mat &inputImage); void run (const Mat &inputImage);
@ -38,22 +38,22 @@ The retina can be settled up with various parameters, by default, the retina can
void getMagno (Mat &retinaOutput_magno); void getMagno (Mat &retinaOutput_magno);
void getMagno (std::valarray< float > &retinaOutput_magno); void getMagno (std::valarray< float > &retinaOutput_magno);
const std::valarray< float > & getMagno () const; const std::valarray< float > & getMagno () const;
// reset retina buffers... equivalent to closing your eyes for some seconds // reset retina buffers... equivalent to closing your eyes for some seconds
void clearBuffers (); void clearBuffers ();
// retreive input and output buffers sizes // retreive input and output buffers sizes
Size inputSize (); Size inputSize ();
Size outputSize (); Size outputSize ();
// setup methods with specific parameters specification of global xml config file loading/write // setup methods with specific parameters specification of global xml config file loading/write
void setup (std::string retinaParameterFile="", const bool applyDefaultSetupOnFailure=true); void setup (std::string retinaParameterFile="", const bool applyDefaultSetupOnFailure=true);
void setup (cv::FileStorage &fs, const bool applyDefaultSetupOnFailure=true); void setup (FileStorage &fs, const bool applyDefaultSetupOnFailure=true);
void setup (RetinaParameters newParameters); void setup (RetinaParameters newParameters);
struct Retina::RetinaParameters getParameters (); struct Retina::RetinaParameters getParameters ();
const std::string printSetup (); const std::string printSetup ();
virtual void write (std::string fs) const; virtual void write (std::string fs) const;
virtual void write (FileStorage &fs) const; virtual void write (FileStorage &fs) const;
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); 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);
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); 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);
void setColorSaturation (const bool saturateColors=true, const float colorSaturationValue=4.0); void setColorSaturation (const bool saturateColors=true, const float colorSaturationValue=4.0);
@ -75,13 +75,13 @@ Class which allows the `Gipsa <http://www.gipsa-lab.inpg.fr>`_ (preliminary work
* local logarithmic luminance compression allows details to be enhanced even in low light conditions * local logarithmic luminance compression allows details to be enhanced even in low light conditions
Use : this model can be used basically for spatio-temporal video effects but also in the aim of : Use : this model can be used basically for spatio-temporal video effects but also in the aim of :
* performing texture analysis with enhanced signal to noise ratio and enhanced details robust against input images luminance ranges (check out the parvocellular retina channel output, by using the provided **getParvo** methods) * performing texture analysis with enhanced signal to noise ratio and enhanced details robust against input images luminance ranges (check out the parvocellular retina channel output, by using the provided **getParvo** methods)
* performing motion analysis also taking benefit of the previously cited properties (check out the magnocellular retina channel output, by using the provided **getMagno** methods) * performing motion analysis also taking benefit of the previously cited properties (check out the magnocellular retina channel output, by using the provided **getMagno** methods)
For more information, refer to the following papers : For more information, refer 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> * 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>
@ -100,7 +100,7 @@ Demos and experiments !
Take a look at the C++ examples provided with OpenCV : Take a look at the C++ examples provided with OpenCV :
* **samples/cpp/retinademo.cpp** shows how to use the retina module for details enhancement (Parvo channel output) and transient maps observation (Magno channel output). You can play with images, video sequences and webcam video. * **samples/cpp/retinademo.cpp** shows how to use the retina module for details enhancement (Parvo channel output) and transient maps observation (Magno channel output). You can play with images, video sequences and webcam video.
Typical uses are (provided your OpenCV installation is situated in folder *OpenCVReleaseFolder*) Typical uses are (provided your OpenCV installation is situated in folder *OpenCVReleaseFolder*)
* image processing : **OpenCVReleaseFolder/bin/retinademo -image myPicture.jpg** * image processing : **OpenCVReleaseFolder/bin/retinademo -image myPicture.jpg**
@ -110,7 +110,7 @@ Take a look at the C++ examples provided with OpenCV :
* webcam processing: **OpenCVReleaseFolder/bin/retinademo -video** * webcam processing: **OpenCVReleaseFolder/bin/retinademo -video**
**Note :** This demo generates the file *RetinaDefaultParameters.xml* which contains the default parameters of the retina. Then, rename this as *RetinaSpecificParameters.xml*, adjust the parameters the way you want and reload the program to check the effect. **Note :** This demo generates the file *RetinaDefaultParameters.xml* which contains the default parameters of the retina. Then, rename this as *RetinaSpecificParameters.xml*, adjust the parameters the way you want and reload the program to check the effect.
* **samples/cpp/OpenEXRimages_HighDynamicRange_Retina_toneMapping.cpp** shows how to use the retina to perform High Dynamic Range (HDR) luminance compression * **samples/cpp/OpenEXRimages_HighDynamicRange_Retina_toneMapping.cpp** shows how to use the retina to perform High Dynamic Range (HDR) luminance compression
@ -119,13 +119,13 @@ Take a look at the C++ examples provided with OpenCV :
Typical use, supposing that you have the OpenEXR image *memorial.exr* (present in the samples/cpp/ folder) Typical use, supposing that you have the OpenEXR image *memorial.exr* (present in the samples/cpp/ folder)
**OpenCVReleaseFolder/bin/OpenEXRimages_HighDynamicRange_Retina_toneMapping memorial.exr** **OpenCVReleaseFolder/bin/OpenEXRimages_HighDynamicRange_Retina_toneMapping memorial.exr**
Note that some sliders are made available to allow you to play with luminance compression. Note that some sliders are made available to allow you to play with luminance compression.
Methods description Methods description
=================== ===================
Here are detailled the main methods to control the retina model Here are detailled the main methods to control the retina model
Retina::Retina Retina::Retina
++++++++++++++ ++++++++++++++
@ -148,7 +148,7 @@ Retina::Retina
Retina::activateContoursProcessing Retina::activateContoursProcessing
++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++
.. ocv:function:: void cv::Retina::activateContoursProcessing(const bool activate) .. ocv:function:: void Retina::activateContoursProcessing(const bool activate)
Activate/desactivate the Parvocellular pathway processing (contours information extraction), by default, it is activated Activate/desactivate the Parvocellular pathway processing (contours information extraction), by default, it is activated
@ -157,7 +157,7 @@ Retina::activateContoursProcessing
Retina::activateMovingContoursProcessing Retina::activateMovingContoursProcessing
++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++
.. ocv:function:: void cv::Retina::activateMovingContoursProcessing(const bool activate) .. ocv:function:: void Retina::activateMovingContoursProcessing(const bool activate)
Activate/desactivate the Magnocellular pathway processing (motion information extraction), by default, it is activated Activate/desactivate the Magnocellular pathway processing (motion information extraction), by default, it is activated
@ -166,42 +166,44 @@ Retina::activateMovingContoursProcessing
Retina::clearBuffers Retina::clearBuffers
++++++++++++++++++++ ++++++++++++++++++++
.. ocv:function:: void cv::Retina::clearBuffers() .. ocv:function:: void Retina::clearBuffers()
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. 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.
Retina::getParvo Retina::getParvo
++++++++++++++++ ++++++++++++++++
.. ocv:function:: void cv::Retina::getParvo(Mat & retinaOutput_parvo) .. ocv:function:: void Retina::getParvo( Mat & retinaOutput_parvo )
.. ocv:function:: void cv::Retina::getParvo(std::valarray< float > & retinaOutput_parvo ) .. ocv:function:: void Retina::getParvo( std::valarray<float> & retinaOutput_parvo )
.. ocv:function:: const std::valarray<float> & Retina::getParvo() const
Accessor of the details channel of the retina (models foveal vision) Accessor of the details channel of the retina (models foveal vision)
:param retinaOutput_parvo: the output buffer (reallocated if necessary), format can be : :param retinaOutput_parvo: the output buffer (reallocated if necessary), format can be :
* a cv::Mat, this output is rescaled for standard 8bits image processing use in OpenCV * a Mat, this output is rescaled for standard 8bits image processing use in OpenCV
* a 1D std::valarray Buffer (encoding is R1, R2, ... Rn), this output is the original retina filter model output, without any quantification or rescaling * a 1D std::valarray Buffer (encoding is R1, R2, ... Rn), this output is the original retina filter model output, without any quantification or rescaling
Retina::getMagno Retina::getMagno
++++++++++++++++ ++++++++++++++++
.. ocv:function:: void cv::Retina::getMagno(Mat & retinaOutput_magno) .. ocv:function:: void Retina::getMagno( Mat & retinaOutput_magno )
.. ocv:function:: void cv::Retina::getMagno(std::valarray< float > & retinaOutput_magno) .. ocv:function:: void Retina::getMagno( std::valarray<float> & retinaOutput_magno )
.. ocv:function:: const std::valarray<float> & Retina::getMagno() const
Accessor of the motion channel of the retina (models peripheral vision) Accessor of the motion channel of the retina (models peripheral vision)
:param retinaOutput_magno: the output buffer (reallocated if necessary), format can be : :param retinaOutput_magno: the output buffer (reallocated if necessary), format can be :
* a cv::Mat, this output is rescaled for standard 8bits image processing use in OpenCV * a Mat, this output is rescaled for standard 8bits image processing use in OpenCV
* a 1D std::valarray Buffer (encoding is R1, R2, ... Rn), this output is the original retina filter model output, without any quantification or rescaling * a 1D std::valarray Buffer (encoding is R1, R2, ... Rn), this output is the original retina filter model output, without any quantification or rescaling
Retina::getParameters Retina::getParameters
+++++++++++++++++++++ +++++++++++++++++++++
.. ocv:function:: struct Retina::RetinaParameters cv::Retina::getParameters() .. ocv:function:: struct Retina::RetinaParameters Retina::getParameters()
Retrieve the current parameters values in a *Retina::RetinaParameters* structure Retrieve the current parameters values in a *Retina::RetinaParameters* structure
@ -210,7 +212,7 @@ Retina::getParameters
Retina::inputSize Retina::inputSize
+++++++++++++++++ +++++++++++++++++
.. ocv:function:: Size cv::Retina::inputSize() .. ocv:function:: Size Retina::inputSize()
Retreive retina input buffer size Retreive retina input buffer size
@ -219,16 +221,16 @@ Retina::inputSize
Retina::outputSize Retina::outputSize
++++++++++++++++++ ++++++++++++++++++
.. ocv:function:: Size cv::Retina::outputSize() .. ocv:function:: Size Retina::outputSize()
Retreive retina output buffer size that can be different from the input if a spatial log transformation is applied Retreive retina output buffer size that can be different from the input if a spatial log transformation is applied
:return: the retina output buffer size :return: the retina output buffer size
Retina::printSetup Retina::printSetup
++++++++++++++++++ ++++++++++++++++++
.. ocv:function:: const std::string cv::Retina::printSetup() .. ocv:function:: const std::string Retina::printSetup()
Outputs a string showing the used parameters setup Outputs a string showing the used parameters setup
@ -237,16 +239,16 @@ Retina::printSetup
Retina::run Retina::run
+++++++++++ +++++++++++
.. ocv:function:: void cv::Retina::run(const Mat & inputImage) .. ocv:function:: void Retina::run(const Mat & inputImage)
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 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
:param inputImage: the input cv::Mat image to be processed, can be gray level or BGR coded in any format (from 8bit to 16bits) :param inputImage: the input Mat image to be processed, can be gray level or BGR coded in any format (from 8bit to 16bits)
Retina::setColorSaturation Retina::setColorSaturation
++++++++++++++++++++++++++ ++++++++++++++++++++++++++
.. ocv:function:: void cv::Retina::setColorSaturation(const bool saturateColors = true, const float colorSaturationValue = 4.0 ) .. ocv:function:: void Retina::setColorSaturation(const bool saturateColors = true, const float colorSaturationValue = 4.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. 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.
@ -257,9 +259,9 @@ Retina::setColorSaturation
Retina::setup Retina::setup
+++++++++++++ +++++++++++++
.. ocv:function:: void cv::Retina::setup(std::string retinaParameterFile = "", const bool applyDefaultSetupOnFailure = true ) .. ocv:function:: void Retina::setup(std::string retinaParameterFile = "", const bool applyDefaultSetupOnFailure = true )
.. ocv:function:: void cv::Retina::setup(cv::FileStorage & fs, const bool applyDefaultSetupOnFailure = true ) .. ocv:function:: void Retina::setup(FileStorage & fs, const bool applyDefaultSetupOnFailure = true )
.. ocv:function:: void cv::Retina::setup(RetinaParameters newParameters) .. ocv:function:: void Retina::setup(RetinaParameters newParameters)
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 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
@ -271,8 +273,8 @@ Retina::setup
Retina::write Retina::write
+++++++++++++ +++++++++++++
.. ocv:function:: virtual void cv::Retina::write(std::string fs) const .. ocv:function:: void Retina::write( std::string fs ) const
.. ocv:function:: virtual void cv::Retina::write(FileStorage & fs) const .. ocv:function:: void Retina::write( FileStorage& fs ) const
Write xml/yml formated parameters information Write xml/yml formated parameters information
@ -281,7 +283,7 @@ Retina::write
Retina::setupIPLMagnoChannel Retina::setupIPLMagnoChannel
++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++
.. ocv:function:: void cv::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 ) .. ocv:function:: void 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 )
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. 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.
@ -297,7 +299,7 @@ Retina::setupIPLMagnoChannel
Retina::setupOPLandIPLParvoChannel Retina::setupOPLandIPLParvoChannel
++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++
.. ocv:function:: void cv::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 ) .. ocv:function:: void 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 )
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 a part of the Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. See reference papers for more informations. 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 a part of the Inner Plexiform layer of the retina, it allows high contours sensitivity in foveal vision. See reference papers for more informations.
@ -315,12 +317,12 @@ Retina::setupOPLandIPLParvoChannel
Retina::RetinaParameters Retina::RetinaParameters
======================== ========================
.. ocv:class:: RetinaParameters .. ocv:struct:: Retina::RetinaParameters
This structure merges all the parameters that can be adjusted threw the **cv::Retina::setup()**, **cv::Retina::setupOPLandIPLParvoChannel** and **cv::Retina::setupIPLMagnoChannel** setup methods This structure merges all the parameters that can be adjusted threw the **Retina::setup()**, **Retina::setupOPLandIPLParvoChannel** and **Retina::setupIPLMagnoChannel** setup methods
Parameters structure for better clarity, check explenations on the comments of methods : setupOPLandIPLParvoChannel and setupIPLMagnoChannel. :: Parameters structure for better clarity, check explenations on the comments of methods : setupOPLandIPLParvoChannel and setupIPLMagnoChannel. ::
class RetinaParameters{ class RetinaParameters{
struct OPLandIplParvoParameters{ // Outer Plexiform Layer (OPL) and Inner Plexiform Layer Parvocellular (IplParvo) parameters struct OPLandIplParvoParameters{ // Outer Plexiform Layer (OPL) and Inner Plexiform Layer Parvocellular (IplParvo) parameters
OPLandIplParvoParameters():colorMode(true), OPLandIplParvoParameters():colorMode(true),
normaliseOutput(true), // specifies if (true) output is rescaled between 0 and 255 of not (false) normaliseOutput(true), // specifies if (true) output is rescaled between 0 and 255 of not (false)
photoreceptorsLocalAdaptationSensitivity(0.7f), // the photoreceptors sensitivity renage is 0-1 (more log compression effect when value increases) photoreceptorsLocalAdaptationSensitivity(0.7f), // the photoreceptors sensitivity renage is 0-1 (more log compression effect when value increases)

@ -222,7 +222,7 @@ protected:
void getLikelihoods(const Mat& queryImgDescriptor, const vector< void getLikelihoods(const Mat& queryImgDescriptor, const vector<
Mat>& testImgDescriptors, vector<IMatch>& matches); Mat>& testImgDescriptors, vector<IMatch>& matches);
//procomputed data //precomputed data
int (*table)[8]; int (*table)[8];
//data precision //data precision

@ -818,23 +818,23 @@ Performs linear blending of two images.
:param result: Destination image. :param result: Destination image.
:param stream: Stream for the asynchronous version. :param stream: Stream for the asynchronous version.
gpu::bilateralFilter gpu::bilateralFilter
------------------- --------------------
Performs bilateral filtering of passed image Performs bilateral filtering of passed image
.. ocv:function:: void gpu::bilateralFilter(const GpuMat& src, GpuMat& dst, int kernel_size, float sigma_color, float sigma_spatial, int borderMode, Stream& stream = Stream::Null()); .. ocv:function:: void gpu::bilateralFilter(const GpuMat& src, GpuMat& dst, int kernel_size, float sigma_color, float sigma_spatial, int borderMode, Stream& stream = Stream::Null())
:param src: Source image. Supports only (channles != 2 && depth() != CV_8S && depth() != CV_32S && depth() != CV_64F). :param src: Source image. Supports only (channles != 2 && depth() != CV_8S && depth() != CV_32S && depth() != CV_64F).
:param dst: Destination imagwe. :param dst: Destination imagwe.
:param kernel_size: Kernel window size. :param kernel_size: Kernel window size.
:param sigma_color: Filter sigma in the color space. :param sigma_color: Filter sigma in the color space.
:param sigma_spatial: Filter sigma in the coordinate space. :param sigma_spatial: Filter sigma in the coordinate space.
:param borderMode: Border type. See :ocv:func:`borderInterpolate` for details. ``BORDER_REFLECT101`` , ``BORDER_REPLICATE`` , ``BORDER_CONSTANT`` , ``BORDER_REFLECT`` and ``BORDER_WRAP`` are supported for now. :param borderMode: Border type. See :ocv:func:`borderInterpolate` for details. ``BORDER_REFLECT101`` , ``BORDER_REPLICATE`` , ``BORDER_CONSTANT`` , ``BORDER_REFLECT`` and ``BORDER_WRAP`` are supported for now.
@ -843,24 +843,24 @@ Performs bilateral filtering of passed image
.. seealso:: .. seealso::
:ocv:func:`bilateralFilter`, :ocv:func:`bilateralFilter`,
gpu::nonLocalMeans gpu::nonLocalMeans
------------------- -------------------
Performs pure non local means denoising without any simplification, and thus it is not fast. Performs pure non local means denoising without any simplification, and thus it is not fast.
.. ocv:function:: void nonLocalMeans(const GpuMat& src, GpuMat& dst, float h, int search_widow_size = 11, int block_size = 7, int borderMode = BORDER_DEFAULT, Stream& s = Stream::Null()); .. ocv:function:: void nonLocalMeans(const GpuMat& src, GpuMat& dst, float h, int search_widow_size = 11, int block_size = 7, int borderMode = BORDER_DEFAULT, Stream& s = Stream::Null())
:param src: Source image. Supports only CV_8UC1, CV_8UC3. :param src: Source image. Supports only CV_8UC1, CV_8UC3.
:param dst: Destination imagwe. :param dst: Destination imagwe.
:param h: Filter sigma regulating filter strength for color. :param h: Filter sigma regulating filter strength for color.
:param search_widow_size: Size of search window. :param search_widow_size: Size of search window.
:param block_size: Size of block used for computing weights. :param block_size: Size of block used for computing weights.
:param borderMode: Border type. See :ocv:func:`borderInterpolate` for details. ``BORDER_REFLECT101`` , ``BORDER_REPLICATE`` , ``BORDER_CONSTANT`` , ``BORDER_REFLECT`` and ``BORDER_WRAP`` are supported for now. :param borderMode: Border type. See :ocv:func:`borderInterpolate` for details. ``BORDER_REFLECT101`` , ``BORDER_REPLICATE`` , ``BORDER_CONSTANT`` , ``BORDER_REFLECT`` and ``BORDER_WRAP`` are supported for now.
:param stream: Stream for the asynchronous version. :param stream: Stream for the asynchronous version.
@ -868,7 +868,7 @@ Performs pure non local means denoising without any simplification, and thus it
.. seealso:: .. seealso::
:ocv:func:`fastNlMeansDenoising` :ocv:func:`fastNlMeansDenoising`
gpu::alphaComp gpu::alphaComp
------------------- -------------------
Composites two images using alpha opacity values contained in each image. Composites two images using alpha opacity values contained in each image.

@ -1,5 +1,5 @@
import os, sys, re, string, fnmatch import os, sys, re, string, fnmatch
allmodules = ["core", "flann", "imgproc", "ml", "highgui", "video", "features2d", "calib3d", "objdetect", "legacy", "contrib", "gpu", "androidcamera", "java", "python", "stitching", "ts", "photo", "nonfree", "videostab"] allmodules = ["core", "flann", "imgproc", "ml", "highgui", "video", "features2d", "calib3d", "objdetect", "legacy", "contrib", "gpu", "androidcamera", "java", "python", "stitching", "ts", "photo", "nonfree", "videostab", "ocl"]
verbose = False verbose = False
show_warnings = True show_warnings = True
show_errors = True show_errors = True
@ -342,7 +342,7 @@ class RstParser(object):
continue continue
ll = l.rstrip() ll = l.rstrip()
if len(prev_line) > 0 and len(ll) >= len(prev_line) and (ll == "-" * len(ll) or ll == "+" * len(ll)): if len(prev_line) > 0 and len(ll) >= len(prev_line) and (ll == "-" * len(ll) or ll == "+" * len(ll) or ll == "=" * len(ll)):
# new function candidate # new function candidate
if len(lines) > 1: if len(lines) > 1:
self.parse_section_safe(module_name, fname, doc, flineno, lines[:len(lines)-1]) self.parse_section_safe(module_name, fname, doc, flineno, lines[:len(lines)-1])

@ -155,6 +155,8 @@ class CppHeaderParser(object):
elif angle_stack: elif angle_stack:
arg_type += w arg_type += w
angle_stack[-1] += 1 angle_stack[-1] += 1
elif arg_type == "struct":
arg_type += " " + w
elif arg_type and arg_type != "~": elif arg_type and arg_type != "~":
arg_name = " ".join(word_list[wi:]) arg_name = " ".join(word_list[wi:])
break break
@ -429,7 +431,7 @@ class CppHeaderParser(object):
decl_start = decl_start[0:-2].rstrip() + " ()" decl_start = decl_start[0:-2].rstrip() + " ()"
# constructor/destructor case # constructor/destructor case
if bool(re.match(r'(\w+::)*(?P<x>\w+)::~?(?P=x)', decl_start)): if bool(re.match(r'^(\w+::)*(?P<x>\w+)::~?(?P=x)$', decl_start)):
decl_start = "void " + decl_start decl_start = "void " + decl_start
rettype, funcname, modlist, argno = self.parse_arg(decl_start, -1) rettype, funcname, modlist, argno = self.parse_arg(decl_start, -1)
@ -441,10 +443,14 @@ class CppHeaderParser(object):
else: else:
if bool(re.match('\w+\s+\(\*\w+\)\s*\(.*\)', decl_str)): if bool(re.match('\w+\s+\(\*\w+\)\s*\(.*\)', decl_str)):
return [] # function typedef return [] # function typedef
elif bool(re.match('\w+\s+\(\w+::\*\w+\)\s*\(.*\)', decl_str)):
return [] # class method typedef
elif bool(re.match('[A-Z_]+', decl_start)): elif bool(re.match('[A-Z_]+', decl_start)):
return [] # it seems to be a macro instantiation return [] # it seems to be a macro instantiation
elif "__declspec" == decl_start: elif "__declspec" == decl_start:
return [] return []
elif bool(re.match(r'\w+\s+\(\*\w+\)\[\d+\]', decl_str)):
return [] # exotic - dynamic 2d array
else: else:
#print rettype, funcname, modlist, argno #print rettype, funcname, modlist, argno
print "Error at %s:%d the function/method name is missing: '%s'" % (self.hname, self.lineno, decl_start) print "Error at %s:%d the function/method name is missing: '%s'" % (self.hname, self.lineno, decl_start)
@ -799,6 +805,10 @@ class CppHeaderParser(object):
stmt = " ".join(stmt.split()) # normalize the statement stmt = " ".join(stmt.split()) # normalize the statement
stack_top = self.block_stack[-1] stack_top = self.block_stack[-1]
if stmt.startswith("@"):
# Objective C ?
break
decl = None decl = None
if stack_top[self.PROCESS_FLAG]: if stack_top[self.PROCESS_FLAG]:
# even if stack_top[PUBLIC_SECTION] is False, we still try to process the statement, # even if stack_top[PUBLIC_SECTION] is False, we still try to process the statement,
@ -850,5 +860,7 @@ if __name__ == '__main__':
decls = [] decls = []
for hname in opencv_hdr_list: for hname in opencv_hdr_list:
decls += parser.parse(hname) decls += parser.parse(hname)
#for hname in sys.argv[1:]:
#decls += parser.parse(hname, wmode=False)
parser.print_decls(decls) parser.print_decls(decls)
print len(decls) print len(decls)

Loading…
Cancel
Save