Fixed several mistakes in documentation

This commit is contained in:
Andrey Kamaev 2012-07-05 07:30:45 +00:00
parent 5f8715c8b4
commit b1eba01afb
7 changed files with 77 additions and 77 deletions

View File

@ -312,7 +312,7 @@ def process_module(module, path):
if namespace: if namespace:
name = name[len(namespace) + 1:] name = name[len(namespace) + 1:]
#print namespace, parent, name, fn[0] #print namespace, parent, name, fn[0]
if not namespace and not parent and not name.startswith("cv") and not name.startswith("CV_"): if not namespace and not parent and not name.startswith("cv") and not name.startswith("icv") and not name.startswith("CV_"):
logerror(ERROR_004_MISSEDNAMESPACE, "function " + name + " from opencv_" + module + " is placed in global namespace but violates C-style naming convention") logerror(ERROR_004_MISSEDNAMESPACE, "function " + name + " from opencv_" + module + " is placed in global namespace but violates C-style naming convention")
else: else:
fdescr = (namespace, parent, name, fn) fdescr = (namespace, parent, name, fn)

View File

@ -55,10 +55,10 @@ In OpenCV 2.4 you only need :ocv:func:`applyColorMap` to apply a colormap on a g
if (argc > 1) { if (argc > 1) {
filename = string(argv[1]); filename = string(argv[1]);
} }
// The following lines show how to apply a colormap on a given image // The following lines show how to apply a colormap on a given image
// and show it with cv::imshow example with an image. An exception is // and show it with cv::imshow example with an image. An exception is
// thrown if the path to the image is invalid. // thrown if the path to the image is invalid.
if(!filename.empty()) { if(!filename.empty()) {
Mat img0 = imread(filename); Mat img0 = imread(filename);
// Throw an exception, if the image can't be read: // Throw an exception, if the image can't be read:
if(img0.empty()) { if(img0.empty()) {
@ -71,9 +71,9 @@ In OpenCV 2.4 you only need :ocv:func:`applyColorMap` to apply a colormap on a g
// Show the result: // Show the result:
imshow("cm_img0", cm_img0); imshow("cm_img0", cm_img0);
waitKey(0); waitKey(0);
} }
return 0; return 0;
} }
And here are the color scales for each of the available colormaps: And here are the color scales for each of the available colormaps:

View File

@ -6,7 +6,7 @@ FaceRecognizer
FaceRecognizer FaceRecognizer
-------------- --------------
.. ocv:class:: FaceRecognizer .. ocv:class:: FaceRecognizer : public Algorithm
All face recognition models in OpenCV are derived from the abstract base class :ocv:class:`FaceRecognizer`, which provides All face recognition models in OpenCV are derived from the abstract base class :ocv:class:`FaceRecognizer`, which provides
a unified access to all face recongition algorithms in OpenCV. :: a unified access to all face recongition algorithms in OpenCV. ::
@ -143,14 +143,8 @@ And finally train it on the given dataset (the face images and labels):
FaceRecognizer::predict FaceRecognizer::predict
----------------------- -----------------------
.. ocv:function:: int FaceRecognizer::predict(InputArray src) const .. ocv:function:: int FaceRecognizer::predict( InputArray src ) const = 0
.. ocv:function:: void FaceRecognizer::predict( InputArray src, int & label, double & confidence ) const = 0
Predicts a label for a given input image.
:param src: Sample image to get a prediction from.
.. ocv:function:: void predict(InputArray src, int &label, double &confidence) const
Predicts a label and associated confidence (e.g. distance) for a given input image. Predicts a label and associated confidence (e.g. distance) for a given input image.
@ -219,8 +213,8 @@ FaceRecognizer::load
Loads a :ocv:class:`FaceRecognizer` and its model state. Loads a :ocv:class:`FaceRecognizer` and its model state.
.. ocv:function:: void FaceRecognizer::load(const string& filename) .. ocv:function:: void FaceRecognizer::load( const string& filename )
.. ocv:function:: void FaceRecognizer::load(FileStorage& fs) .. ocv:function:: void FaceRecognizer::load( const FileStorage& fs ) = 0
Loads a persisted model and state from a given XML or YAML file . Every Loads a persisted model and state from a given XML or YAML file . Every
:ocv:class:`FaceRecognizer` has to overwrite ``FaceRecognizer::load(FileStorage& fs)`` :ocv:class:`FaceRecognizer` has to overwrite ``FaceRecognizer::load(FileStorage& fs)``

View File

@ -158,7 +158,7 @@ The :math:`k` principal components of the observed vector :math:`x` are then giv
.. math:: .. math::
y = W^{T} (x - \mu) y = W^{T} (x - \mu)
where :math:`W = (v_{1}, v_{2}, \ldots, v_{k})`. where :math:`W = (v_{1}, v_{2}, \ldots, v_{k})`.
@ -167,7 +167,7 @@ The reconstruction from the PCA basis is given by:
.. math:: .. math::
x = W y + \mu x = W y + \mu
where :math:`W = (v_{1}, v_{2}, \ldots, v_{k})`. where :math:`W = (v_{1}, v_{2}, \ldots, v_{k})`.
@ -182,14 +182,14 @@ Still there's one problem left to solve. Imagine we are given :math:`400` images
.. math:: .. math::
X^{T} X v_{i} = \lambda_{i} v{i} X^{T} X v_{i} = \lambda_{i} v{i}
and get the original eigenvectors of :math:`S = X X^{T}` with a left multiplication of the data matrix: and get the original eigenvectors of :math:`S = X X^{T}` with a left multiplication of the data matrix:
.. math:: .. math::
X X^{T} (X v_{i}) = \lambda_{i} (X v_{i}) X X^{T} (X v_{i}) = \lambda_{i} (X v_{i})
The resulting eigenvectors are orthogonal, to get orthonormal eigenvectors they need to be normalized to unit length. I don't want to turn this into a publication, so please look into [Duda01]_ for the derivation and proof of the equations. The resulting eigenvectors are orthogonal, to get orthonormal eigenvectors they need to be normalized to unit length. I don't want to turn this into a publication, so please look into [Duda01]_ for the derivation and proof of the equations.
@ -418,11 +418,11 @@ The operator is an extension to the original LBP codes, so it's sometimes called
\begin{align*} \begin{align*}
f(x,y) \approx \begin{bmatrix} f(x,y) \approx \begin{bmatrix}
1-x & x \end{bmatrix} \begin{bmatrix} 1-x & x \end{bmatrix} \begin{bmatrix}
f(0,0) & f(0,1) \\ f(0,0) & f(0,1) \\
f(1,0) & f(1,1) \end{bmatrix} \begin{bmatrix} f(1,0) & f(1,1) \end{bmatrix} \begin{bmatrix}
1-y \\ 1-y \\
y \end{bmatrix}. y \end{bmatrix}.
\end{align*} \end{align*}
By definition the LBP operator is robust against monotonic gray scale transformations. We can easily verify this by looking at the LBP image of an artificially modified image (so you see what an LBP image looks like!): By definition the LBP operator is robust against monotonic gray scale transformations. We can easily verify this by looking at the LBP image of an artificially modified image (so you see what an LBP image looks like!):

View File

@ -931,7 +931,7 @@ namespace cv
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.
CV_WRAP virtual void predict(InputArray src, CV_OUT int &label, CV_OUT double &dist) const = 0; CV_WRAP virtual void predict(InputArray src, CV_OUT int &label, CV_OUT double &confidence) const = 0;
// Serializes this object to a given filename. // Serializes this object to a given filename.
CV_WRAP virtual void save(const string& filename) const; CV_WRAP virtual void save(const string& filename) const;
@ -970,7 +970,7 @@ namespace cv
CV_EXPORTS_W void applyColorMap(InputArray src, OutputArray dst, int colormap); CV_EXPORTS_W void applyColorMap(InputArray src, OutputArray dst, int colormap);
CV_EXPORTS_W bool initModule_contrib(); CV_EXPORTS bool initModule_contrib();
} }
#include "opencv2/contrib/retina.hpp" #include "opencv2/contrib/retina.hpp"

View File

@ -968,7 +968,7 @@ Smoothes an image using a Gaussian filter.
.. ocv:function:: void GaussianBlur( InputArray src, OutputArray dst, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT ) .. ocv:function:: void GaussianBlur( InputArray src, OutputArray dst, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT )
.. ocv:pyfunction:: cv2.GaussianBlur(src, ksize, sigma1[, dst[, sigma2[, borderType]]]) -> dst .. ocv:pyfunction:: cv2.GaussianBlur(src, ksize, sigmaX[, dst[, sigmaY[, borderType]]]) -> dst
:param src: Source image. The image can have any number of channels, which are processed independently. The depth should be ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32F`` or ``CV_64F``. :param src: Source image. The image can have any number of channels, which are processed independently. The depth should be ``CV_8U``, ``CV_16U``, ``CV_16S``, ``CV_32F`` or ``CV_64F``.

View File

@ -47,6 +47,8 @@ params_mapping = {
} }
} }
known_text_sections_names = ["Appendix", "Results", "Prerequisites", "Introduction", "Description"]
class DeclarationParser(object): class DeclarationParser(object):
def __init__(self, line=None): def __init__(self, line=None):
if line is None: if line is None:
@ -146,7 +148,7 @@ class RstParser(object):
self.sections_total += 1 self.sections_total += 1
# skip sections having whitespace in name # skip sections having whitespace in name
#if section_name.find(" ") >= 0 and section_name.find("::operator") < 0: #if section_name.find(" ") >= 0 and section_name.find("::operator") < 0:
if section_name.find(" ") >= 0 and not bool(re.match(r"(\w+::)*operator\s*(\w+|>>|<<|\(\)|->|\+\+|--|=|==|\+=|-=)", section_name)): if (section_name.find(" ") >= 0 and not bool(re.match(r"(\w+::)*operator\s*(\w+|>>|<<|\(\)|->|\+\+|--|=|==|\+=|-=)", section_name)) ) or section_name.endswith(":"):
if show_errors: if show_errors:
print >> sys.stderr, "RST parser warning W%03d: SKIPPED: \"%s\" File: %s:%s" % (WARNING_002_HDRWHITESPACE, section_name, file_name, lineno) print >> sys.stderr, "RST parser warning W%03d: SKIPPED: \"%s\" File: %s:%s" % (WARNING_002_HDRWHITESPACE, section_name, file_name, lineno)
self.sections_skipped += 1 self.sections_skipped += 1
@ -306,7 +308,11 @@ class RstParser(object):
if verbose: if verbose:
self.print_info(func) self.print_info(func)
elif func: elif func:
if show_errors: if func["name"] in known_text_sections_names:
if show_errors:
print >> sys.stderr, "RST parser warning W%03d: SKIPPED: \"%s\" File: %s:%s" % (WARNING_002_HDRWHITESPACE, section_name, file_name, lineno)
self.sections_skipped += 1
elif show_errors:
self.print_info(func, True, sys.stderr) self.print_info(func, True, sys.stderr)
def parse_rst_file(self, module_name, doc): def parse_rst_file(self, module_name, doc):
@ -336,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): if len(prev_line) > 0 and len(ll) >= len(prev_line) and (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])