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

This commit is contained in:
Andrey Kamaev 2012-09-08 00:40:06 +04:00
parent dc5c7ee68f
commit 0e9405e591
8 changed files with 97 additions and 79 deletions

View File

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

View File

@ -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 = []

View File

@ -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>``.

View File

@ -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
{ {
@ -48,7 +48,7 @@ The retina can be settled up with various parameters, by default, the retina can
// 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 ();
@ -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,7 +221,7 @@ 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
@ -228,7 +230,7 @@ Retina::outputSize
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,8 +317,8 @@ 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{

View File

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

View File

@ -821,10 +821,10 @@ Performs linear blending of two images.
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).
@ -849,7 +849,7 @@ 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.

View File

@ -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])

View File

@ -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)