Commit b1eba01a authored by Andrey Kamaev's avatar Andrey Kamaev

Fixed several mistakes in documentation

parent 5f8715c8
......@@ -312,7 +312,7 @@ def process_module(module, path):
if namespace:
name = name[len(namespace) + 1:]
#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")
else:
fdescr = (namespace, parent, name, fn)
......
......@@ -7,7 +7,7 @@ applyColorMap
Trains a FaceRecognizer with given data and associated labels.
.. ocv:function:: void applyColorMap(InputArray src, OutputArray dst, int colormap)
:param src: The source image, grayscale or colored does not matter.
:param dst: The result is the colormapped source image. Note: :ocv:func:`Mat::create` is called on dst.
:param colormap: The colormap to apply, see the list of available colormaps below.
......@@ -55,10 +55,10 @@ In OpenCV 2.4 you only need :ocv:func:`applyColorMap` to apply a colormap on a g
if (argc > 1) {
filename = string(argv[1]);
}
// 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
// thrown if the path to the image is invalid.
if(!filename.empty()) {
// 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
// thrown if the path to the image is invalid.
if(!filename.empty()) {
Mat img0 = imread(filename);
// Throw an exception, if the image can't be read:
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:
imshow("cm_img0", cm_img0);
waitKey(0);
}
}
return 0;
return 0;
}
And here are the color scales for each of the available colormaps:
......
......@@ -6,7 +6,7 @@ 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
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
-----------------------
.. ocv:function:: int FaceRecognizer::predict(InputArray src) const
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
.. 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 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.
.. ocv:function:: void FaceRecognizer::load(const string& filename)
.. ocv:function:: void FaceRecognizer::load(FileStorage& fs)
.. ocv:function:: void FaceRecognizer::load( const string& filename )
.. ocv:function:: void FaceRecognizer::load( const FileStorage& fs ) = 0
Loads a persisted model and state from a given XML or YAML file . Every
:ocv:class:`FaceRecognizer` has to overwrite ``FaceRecognizer::load(FileStorage& fs)``
......
......@@ -931,7 +931,7 @@ namespace cv
virtual int predict(InputArray src) const = 0;
// 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.
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 bool initModule_contrib();
CV_EXPORTS bool initModule_contrib();
}
#include "opencv2/contrib/retina.hpp"
......
......@@ -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: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``.
......
......@@ -47,6 +47,8 @@ params_mapping = {
}
}
known_text_sections_names = ["Appendix", "Results", "Prerequisites", "Introduction", "Description"]
class DeclarationParser(object):
def __init__(self, line=None):
if line is None:
......@@ -130,7 +132,7 @@ class RstParser(object):
for root, dirs, files in os.walk(os.path.join(module_path,"doc")):
for filename in fnmatch.filter(files, "*.rst"):
doclist.append(os.path.join(root, filename))
for doc in doclist:
self.parse_rst_file(module_name, doc)
......@@ -146,7 +148,7 @@ class RstParser(object):
self.sections_total += 1
# skip sections having whitespace in name
#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:
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
......@@ -306,7 +308,11 @@ class RstParser(object):
if verbose:
self.print_info(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)
def parse_rst_file(self, module_name, doc):
......@@ -336,7 +342,7 @@ class RstParser(object):
continue
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
if len(lines) > 1:
self.parse_section_safe(module_name, fname, doc, flineno, lines[:len(lines)-1])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment