Commit 371aa080 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

OpenCV reference manual (C++ part only for now) is now produced directly from RST, not from TeX.

parent 32a2fde8
This diff is collapsed.
if(BUILD_REFMAN AND PDFLATEX_COMPILER AND HAVE_SPHINX)
project(opencv_refman)
file(GLOB_RECURSE FILES_PICT ../modules/*.png ../modules/*.jpg)
file(GLOB_RECURSE FILES_RST *.rst ../modules/*.rst)
add_custom_target(refman ${SPHINX_BUILD} -b latex -c ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../modules .
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/doc/pics ${CMAKE_CURRENT_BINARY_DIR}/pics
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/doc/latex2sphinx/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${PDFLATEX_COMPILER} opencv
COMMAND ${PDFLATEX_COMPILER} opencv
DEPENDS conf.py ${FILES_RST} ${FILES_PICT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating the Reference Manual")
install(FILES ${CURRENT_BINARY_DIR}/opencv.pdf DESTINATION "${OPENCV_DOC_INSTALL_PATH}" COMPONENT main)
endif()
# -*- coding: utf-8 -*-
#
# opencvstd documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 14 00:30:43 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.pngmath', 'sphinx.ext.ifconfig', 'sphinx.ext.todo']
doctest_test_doctest_blocks = 'block'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'opencvrefman'
copyright = u'2011, opencv dev team'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '2.3'
# The full version, including alpha/beta/rc tags.
release = '2.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
todo_include_todos=True
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'opencv'
# -- Options for LaTeX output --------------------------------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'opencv.tex', u'The OpenCV Reference Manual',
u'', 'manual'),
]
latex_elements = {'preamble': '\usepackage{mymath}\usepackage{amssymb}\usepackage{amsmath}\usepackage{bbm}'}
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# If true, show page references after internal links.
#latex_show_pagerefs = False
# If true, show URL addresses after external links.
#latex_show_urls = False
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_domain_indices = True
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'opencv', u'The OpenCV Reference Manual',
[u'opencv-dev@itseez.com'], 1)
]
****************************************
Camera Calibration and 3D Reconstruction
****************************************
.. toctree::
:maxdepth: 2
camera_calibration_and_3d_reconstruction
This diff is collapsed.
Clustering
==========
.. highlight:: cpp
.. index:: kmeans
cv::kmeans
----------
`id=0.0672046481842 Comments from the Wiki <http://opencv.willowgarage.com/wiki/documentation/cpp/core/kmeans>`__
.. cfunction:: double kmeans( const Mat\& samples, int clusterCount, Mat\& labels, TermCriteria termcrit, int attempts, int flags, Mat* centers )
Finds the centers of clusters and groups the input samples around the clusters.
:param samples: Floating-point matrix of input samples, one row per sample
:param clusterCount: The number of clusters to split the set by
:param labels: The input/output integer array that will store the cluster indices for every sample
:param termcrit: Specifies maximum number of iterations and/or accuracy (distance the centers can move by between subsequent iterations)
:param attempts: How many times the algorithm is executed using different initial labelings. The algorithm returns the labels that yield the best compactness (see the last function parameter)
:param flags: It can take the following values:
* **KMEANS_RANDOM_CENTERS** Random initial centers are selected in each attempt
* **KMEANS_PP_CENTERS** Use kmeans++ center initialization by Arthur and Vassilvitskii
* **KMEANS_USE_INITIAL_LABELS** During the first (and possibly the only) attempt, the
function uses the user-supplied labels instaed of computing them from the initial centers. For the second and further attempts, the function will use the random or semi-random centers (use one of ``KMEANS_*_CENTERS`` flag to specify the exact method)
:param centers: The output matrix of the cluster centers, one row per each cluster center
The function
``kmeans``
implements a k-means algorithm that finds the
centers of
``clusterCount``
clusters and groups the input samples
around the clusters. On output,
:math:`\texttt{labels}_i`
contains a 0-based cluster index for
the sample stored in the
:math:`i^{th}`
row of the
``samples``
matrix.
The function returns the compactness measure, which is computed as
.. math::
\sum _i \| \texttt{samples} _i - \texttt{centers} _{ \texttt{labels} _i} \| ^2
after every attempt; the best (minimum) value is chosen and the
corresponding labels and the compactness value are returned by the function.
Basically, the user can use only the core of the function, set the number of
attempts to 1, initialize labels each time using some custom algorithm and pass them with
(
``flags``
=
``KMEANS_USE_INITIAL_LABELS``
) flag, and then choose the best (most-compact) clustering.
.. index:: partition
cv::partition
-------------
`id=0.0923567235062 Comments from the Wiki <http://opencv.willowgarage.com/wiki/documentation/cpp/core/partition>`__
.. cfunction:: template<typename _Tp, class _EqPredicate> int
.. cfunction:: partition( const vector<_Tp>\& vec, vector<int>\& labels, _EqPredicate predicate=_EqPredicate())
Splits an element set into equivalency classes.
:param vec: The set of elements stored as a vector
:param labels: The output vector of labels; will contain as many elements as ``vec`` . Each label ``labels[i]`` is 0-based cluster index of ``vec[i]``
:param predicate: The equivalence predicate (i.e. pointer to a boolean function of two arguments or an instance of the class that has the method ``bool operator()(const _Tp& a, const _Tp& b)`` . The predicate returns true when the elements are certainly if the same class, and false if they may or may not be in the same class
The generic function
``partition``
implements an
:math:`O(N^2)`
algorithm for
splitting a set of
:math:`N`
elements into one or more equivalency classes, as described in
http://en.wikipedia.org/wiki/Disjoint-set_data_structure
. The function
returns the number of equivalency classes.
******************
Core Functionality
******************
.. toctree::
:maxdepth: 2
basic_structures
operations_on_arrays
dynamic_structures
drawing_functions
xml_yaml_persistence
clustering
utility_and_system_functions_and_macros
This diff is collapsed.
Dynamic Structures
==================
.. highlight:: cpp
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
XML/YAML Persistence
====================
.. highlight:: cpp
.. index:: FileStorage
.. _FileStorage:
FileStorage
-----------
`id=0.36488878292 Comments from the Wiki <http://opencv.willowgarage.com/wiki/documentation/cpp/core/FileStorage>`__
.. ctype:: FileStorage
The XML/YAML file storage class
::
class FileStorage
{
public:
enum { READ=0, WRITE=1, APPEND=2 };
enum { UNDEFINED=0, VALUE_EXPECTED=1, NAME_EXPECTED=2, INSIDE_MAP=4 };
// the default constructor
FileStorage();
// the constructor that opens the file for reading
// (flags=FileStorage::READ) or writing (flags=FileStorage::WRITE)
FileStorage(const string& filename, int flags);
// wraps the already opened CvFileStorage*
FileStorage(CvFileStorage* fs);
// the destructor; closes the file if needed
virtual ~FileStorage();
// opens the specified file for reading (flags=FileStorage::READ)
// or writing (flags=FileStorage::WRITE)
virtual bool open(const string& filename, int flags);
// checks if the storage is opened
virtual bool isOpened() const;
// closes the file
virtual void release();
// returns the first top-level node
FileNode getFirstTopLevelNode() const;
// returns the root file node
// (it's the parent of the first top-level node)
FileNode root(int streamidx=0) const;
// returns the top-level node by name
FileNode operator[](const string& nodename) const;
FileNode operator[](const char* nodename) const;
// returns the underlying CvFileStorage*
CvFileStorage* operator *() { return fs; }
const CvFileStorage* operator *() const { return fs; }
// writes the certain number of elements of the specified format
// (see DataType) without any headers
void writeRaw( const string& fmt, const uchar* vec, size_t len );
// writes an old-style object (CvMat, CvMatND etc.)
void writeObj( const string& name, const void* obj );
// returns the default object name from the filename
// (used by cvSave() with the default object name etc.)
static string getDefaultObjectName(const string& filename);
Ptr<CvFileStorage> fs;
string elname;
vector<char> structs;
int state;
};
..
.. index:: FileNode
.. _FileNode:
FileNode
--------
`id=0.228849909258 Comments from the Wiki <http://opencv.willowgarage.com/wiki/documentation/cpp/core/FileNode>`__
.. ctype:: FileNode
The XML/YAML file node class
::
class CV_EXPORTS FileNode
{
public:
enum { NONE=0, INT=1, REAL=2, FLOAT=REAL, STR=3,
STRING=STR, REF=4, SEQ=5, MAP=6, TYPE_MASK=7,
FLOW=8, USER=16, EMPTY=32, NAMED=64 };
FileNode();
FileNode(const CvFileStorage* fs, const CvFileNode* node);
FileNode(const FileNode& node);
FileNode operator[](const string& nodename) const;
FileNode operator[](const char* nodename) const;
FileNode operator[](int i) const;
int type() const;
int rawDataSize(const string& fmt) const;
bool empty() const;
bool isNone() const;
bool isSeq() const;
bool isMap() const;
bool isInt() const;
bool isReal() const;
bool isString() const;
bool isNamed() const;
string name() const;
size_t size() const;
operator int() const;
operator float() const;
operator double() const;
operator string() const;
FileNodeIterator begin() const;
FileNodeIterator end() const;
void readRaw( const string& fmt, uchar* vec, size_t len ) const;
void* readObj() const;
// do not use wrapper pointer classes for better efficiency
const CvFileStorage* fs;
const CvFileNode* node;
};
..
.. index:: FileNodeIterator
.. _FileNodeIterator:
FileNodeIterator
----------------
`id=0.575104633905 Comments from the Wiki <http://opencv.willowgarage.com/wiki/documentation/cpp/core/FileNodeIterator>`__
.. ctype:: FileNodeIterator
The XML/YAML file node iterator class
::
class CV_EXPORTS FileNodeIterator
{
public:
FileNodeIterator();
FileNodeIterator(const CvFileStorage* fs,
const CvFileNode* node, size_t ofs=0);
FileNodeIterator(const FileNodeIterator& it);
FileNode operator *() const;
FileNode operator ->() const;
FileNodeIterator& operator ++();
FileNodeIterator operator ++(int);
FileNodeIterator& operator --();
FileNodeIterator operator --(int);
FileNodeIterator& operator += (int);
FileNodeIterator& operator -= (int);
FileNodeIterator& readRaw( const string& fmt, uchar* vec,
size_t maxCount=(size_t)INT_MAX );
const CvFileStorage* fs;
const CvFileNode* container;
CvSeqReader reader;
size_t remaining;
};
..
This diff is collapsed.
*********************
2D Features Framework
*********************
.. toctree::
:maxdepth: 2
feature_detection_and_description
common_interfaces_of_feature_detectors
common_interfaces_of_descriptor_extractors
common_interfaces_of_descriptor_matchers
common_interfaces_of_generic_descriptor_matchers
drawing_function_of_keypoints_and_matches
object_categorization
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
****************************
High-level GUI and Media I/O
****************************
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Planar Subdivisions
===================
.. highlight:: cpp
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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