Commit f0624c08 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

propagated some more changes from 2.3 to trunk

parent 6e613bca
# By including this file, all files in the CMAKE_INSTALL_DEBUG_LIBRARIES,
# will be installed with INSTALL_PROGRAMS into /bin for WIN32 and /lib
# for non-win32. If CMAKE_SKIP_INSTALL_RULES is set to TRUE before including
# this file, then the INSTALL command is not called. The use can use
# the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to use a custom install
# command and install them into any directory they want.
# If it is the MSVC compiler, then the microsoft run
# time libraries will be found add automatically added to the
# CMAKE_INSTALL_DEBUG_LIBRARIES, and installed.
# If CMAKE_INSTALL_DEBUG_LIBRARIES is set and it is the MSVC
# compiler, then the debug libraries are installed when available.
# If CMAKE_INSTALL_MFC_LIBRARIES is set then the MFC run time
# libraries are installed as well as the CRT run time libraries.
IF(MSVC)
FILE(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
IF(MSVC70)
SET(__install__libs
"${SYSTEMROOT}/system32/msvcp70.dll"
"${SYSTEMROOT}/system32/msvcr70.dll"
)
ENDIF(MSVC70)
IF(MSVC71)
SET(__install__libs
"${SYSTEMROOT}/system32/msvcp71.dll"
"${SYSTEMROOT}/system32/msvcr71.dll"
)
ENDIF(MSVC71)
IF(CMAKE_CL_64)
SET(CMAKE_MSVC_ARCH amd64)
ELSE(CMAKE_CL_64)
SET(CMAKE_MSVC_ARCH x86)
ENDIF(CMAKE_CL_64)
GET_FILENAME_COMPONENT(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
GET_FILENAME_COMPONENT(base_dir "${devenv_dir}/../.." ABSOLUTE)
IF(MSVC80)
# Find the runtime library redistribution directory.
FIND_PATH(MSVC80_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]/../../VC/redist"
"${base_dir}/VC/redist"
)
MARK_AS_ADVANCED(MSVC80_REDIST_DIR)
SET(MSVC80_CRT_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
SET(__install__libs
"${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest"
"${MSVC80_CRT_DIR}/msvcm80.dll"
"${MSVC80_CRT_DIR}/msvcp80.dll"
"${MSVC80_CRT_DIR}/msvcr80.dll"
)
IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
SET(MSVC80_CRT_DIR
"${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
SET(__install__libs ${__install__libs}
"${MSVC80_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
"${MSVC80_CRT_DIR}/msvcm80d.dll"
"${MSVC80_CRT_DIR}/msvcp80d.dll"
"${MSVC80_CRT_DIR}/msvcr80d.dll"
)
ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
ENDIF(MSVC80)
IF(MSVC90)
# Find the runtime library redistribution directory.
FIND_PATH(MSVC90_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]/../../VC/redist"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]/../../VC/redist"
"${base_dir}/VC/redist"
)
MARK_AS_ADVANCED(MSVC90_REDIST_DIR)
SET(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
SET(__install__libs
"${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest"
"${MSVC90_CRT_DIR}/msvcm90.dll"
"${MSVC90_CRT_DIR}/msvcp90.dll"
"${MSVC90_CRT_DIR}/msvcr90.dll"
)
IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
SET(MSVC90_CRT_DIR
"${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
SET(__install__libs ${__install__libs}
"${MSVC90_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
"${MSVC90_CRT_DIR}/msvcm90d.dll"
"${MSVC90_CRT_DIR}/msvcp90d.dll"
"${MSVC90_CRT_DIR}/msvcr90d.dll"
)
ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
IF(CMAKE_INSTALL_OPENMP_LIBRARIES)
SET(MSVC90_OPENMP_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.OPENMP")
SET(__install__libs ${__install__libs}
"${MSVC90_OPENMP_DIR}/Microsoft.VC90.OpenMP.manifest"
"${MSVC90_OPENMP_DIR}/vcomp90.dll"
)
IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
SET(MSVC90_OPENMP_DIR
"${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugOPENMP")
SET(__install__libs ${__install__libs}
"${MSVC90_OPENMP_DIR}/Microsoft.VC90.DebugOpenMP.manifest"
"${MSVC90_OPENMP_DIR}/vcomp90d.dll"
)
ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
ENDIF(CMAKE_INSTALL_OPENMP_LIBRARIES)
ENDIF(MSVC90)
IF(CMAKE_INSTALL_MFC_LIBRARIES)
IF(MSVC70)
SET(__install__libs ${__install__libs}
"${SYSTEMROOT}/system32/mfc70.dll"
)
ENDIF(MSVC70)
IF(MSVC71)
SET(__install__libs ${__install__libs}
"${SYSTEMROOT}/system32/mfc71.dll"
)
ENDIF(MSVC71)
IF(MSVC80)
IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
SET(MSVC80_MFC_DIR
"${MSVC80_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
SET(__install__libs ${__install__libs}
"${MSVC80_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
"${MSVC80_MFC_DIR}/mfc80d.dll"
"${MSVC80_MFC_DIR}/mfc80ud.dll"
"${MSVC80_MFC_DIR}/mfcm80d.dll"
"${MSVC80_MFC_DIR}/mfcm80ud.dll"
)
ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
SET(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
SET(__install__libs ${__install__libs}
"${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest"
"${MSVC80_MFC_DIR}/mfc80.dll"
"${MSVC80_MFC_DIR}/mfc80u.dll"
"${MSVC80_MFC_DIR}/mfcm80.dll"
"${MSVC80_MFC_DIR}/mfcm80u.dll"
)
# include the language dll's for vs8 as well as the actuall dll's
SET(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
SET(__install__libs ${__install__libs}
"${MSVC80_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
"${MSVC80_MFCLOC_DIR}/mfc80chs.dll"
"${MSVC80_MFCLOC_DIR}/mfc80cht.dll"
"${MSVC80_MFCLOC_DIR}/mfc80enu.dll"
"${MSVC80_MFCLOC_DIR}/mfc80esp.dll"
"${MSVC80_MFCLOC_DIR}/mfc80deu.dll"
"${MSVC80_MFCLOC_DIR}/mfc80fra.dll"
"${MSVC80_MFCLOC_DIR}/mfc80ita.dll"
"${MSVC80_MFCLOC_DIR}/mfc80jpn.dll"
"${MSVC80_MFCLOC_DIR}/mfc80kor.dll"
)
ENDIF(MSVC80)
IF(MSVC90)
IF(CMAKE_INSTALL_DEBUG_LIBRARIES)
SET(MSVC90_MFC_DIR
"${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
SET(__install__libs ${__install__libs}
"${MSVC90_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
"${MSVC90_MFC_DIR}/mfc90d.dll"
"${MSVC90_MFC_DIR}/mfc90ud.dll"
"${MSVC90_MFC_DIR}/mfcm90d.dll"
"${MSVC90_MFC_DIR}/mfcm90ud.dll"
)
ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES)
SET(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
SET(__install__libs ${__install__libs}
"${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest"
"${MSVC90_MFC_DIR}/mfc90.dll"
"${MSVC90_MFC_DIR}/mfc90u.dll"
"${MSVC90_MFC_DIR}/mfcm90.dll"
"${MSVC90_MFC_DIR}/mfcm90u.dll"
)
# include the language dll's for vs9 as well as the actuall dll's
SET(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
SET(__install__libs ${__install__libs}
"${MSVC90_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
"${MSVC90_MFCLOC_DIR}/mfc90chs.dll"
"${MSVC90_MFCLOC_DIR}/mfc90cht.dll"
"${MSVC90_MFCLOC_DIR}/mfc90enu.dll"
"${MSVC90_MFCLOC_DIR}/mfc90esp.dll"
"${MSVC90_MFCLOC_DIR}/mfc90deu.dll"
"${MSVC90_MFCLOC_DIR}/mfc90fra.dll"
"${MSVC90_MFCLOC_DIR}/mfc90ita.dll"
"${MSVC90_MFCLOC_DIR}/mfc90jpn.dll"
"${MSVC90_MFCLOC_DIR}/mfc90kor.dll"
)
ENDIF(MSVC90)
ENDIF(CMAKE_INSTALL_MFC_LIBRARIES)
FOREACH(lib
${__install__libs}
)
IF(EXISTS ${lib})
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
ENDIF(EXISTS ${lib})
ENDFOREACH(lib)
ENDIF(MSVC)
# Include system runtime libraries in the installation if any are
# specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
IF(WIN32)
INSTALL_PROGRAMS(/bin ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
ELSE(WIN32)
INSTALL_PROGRAMS(/lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
ENDIF(WIN32)
ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
......@@ -10,7 +10,6 @@ endif()
#if(ENABLE_OPENMP)
# set(CMAKE_INSTALL_OPENMP_LIBRARIES 1)
#endif()
#include(OpenCVInstallRequiredSystemLibraries.cmake)
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_NAME "OpenCV")
......@@ -77,7 +76,7 @@ set(CPACK_SOURCE_PACKAGE_FILE_NAME
if(WIN32)
set(CPACK_GENERATOR "NSIS")
set(CPACK_SOURCE_GENERATOR "ZIP")
set(CPACK_NSIS_PACKAGE_NAME "OpenCV ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_NSIS_PACKAGE_NAME "OpenCV ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}rc")
set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}\\\\doc\\\\opencv.ico")
set(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}\\\\doc\\\\opencv.ico")
#set(CPACK_PACKAGE_ICON "utils/opencv.ico")
......@@ -90,7 +89,9 @@ if(WIN32)
set(CPACK_NSIS_MENU_LINKS
"http://opencv.willowgarage.com" "Start Page"
"doc\\\\opencv.pdf" "The Reference Manual"
"doc\\\\opencv2refman_cpp.pdf" "The OpenCV C++ Reference Manual"
"doc\\\\opencv2refman_py.pdf" "The OpenCV Python Reference Manual"
"doc\\\\opencv_tutorials.pdf" "The OpenCV Tutorials for Beginners"
"CMakeLists.txt" "The Build Script (open with CMake)"
"samples\\\\c" "C Samples"
"samples\\\\cpp" "C++ Samples"
......
......@@ -13,12 +13,13 @@ project(opencv_docs)
file(GLOB_RECURSE OPENCV2_FILES_PICT ../modules/*.png ../modules/*.jpg)
file(GLOB_RECURSE OPENCV2_FILES_RST ../modules/*.rst)
file(GLOB_RECURSE OPENCV2_PY_FILES_RST opencv2/*.rst)
file(GLOB_RECURSE OPENCV1_FILES_PICT pics/*.png pics/*.jpg)
file(GLOB_RECURSE OPENCV1_FILES_RST opencv1/*.rst)
file(GLOB_RECURSE OPENCV_FILES_UG user_guide/*.rst)
file(GLOB_RECURSE OPENCV_FILES_TUT tutorials/*.rst)
set(OPENCV_DOC_DEPS conf.py ${OPENCV2_FILES_RST} ${OPENCV2_FILES_PICT}
set(OPENCV_DOC_DEPS conf.py ${OPENCV2_FILES_RST} ${OPENCV2_FILES_PICT} ${OPENCV2_PY_FILES_RST}
${OPENCV1_FILES_RST} ${OPENCV1_FILES_PICT}
${OPENCV_FILES_UG} ${OPENCV_FILES_TUT})
......@@ -30,8 +31,10 @@ add_custom_target(docs
${CMAKE_CURRENT_SOURCE_DIR}/pics ${CMAKE_CURRENT_BINARY_DIR}/doc/opencv1/pics
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${PDFLATEX_COMPILER} opencv2refman
COMMAND ${PDFLATEX_COMPILER} opencv2refman
COMMAND ${PDFLATEX_COMPILER} opencv2refman_cpp
COMMAND ${PDFLATEX_COMPILER} opencv2refman_cpp
COMMAND ${PDFLATEX_COMPILER} opencv2refman_py
COMMAND ${PDFLATEX_COMPILER} opencv2refman_py
COMMAND ${PDFLATEX_COMPILER} opencv1refman_c
COMMAND ${PDFLATEX_COMPILER} opencv1refman_c
COMMAND ${PDFLATEX_COMPILER} opencv1refman_py
......
This file describes how to create the opencv.pdf manual in the
.../opencv/doc directory. It further describes how to produce
the html files on disk that populate the online OpenCV documenation
wiki.
-------------------------------------------------------------------------
In Ubuntu or Debian, required to build the opencv.pdf manual:
sudo apt-get install texlive texlive-latex-extra latex-xcolor texlive-fonts-extra
To build the HTML documentation, these are also required:
sudo apt-get install python-setuptools ## See [1] below for another install method
sudo easy_install -U Sphinx ## This is NOT the speech recognition program.
sudo apt-get install dvipng
sudo easy_install plasTeX
-------------------------------------------------------------------------
In other Linux distros you will also need to install LiveTeX and,
optionally, if you want to produce the hmtl files, the Sphinx tool (http://sphinx.pocoo.org/)
In MacOSX you can use MacTex (https://www.tug.org/mactex/).
In Windows you can use MiKTeX
--------------------------------------------------------------------------
(1) To build the latex files to create the opencv.pdf manual, in the
.../opencv/doc directory, issue the command:
sh go
(2) If you want to build the html files that OpenCV uses to populate the
online documentation, assuming you downloaded easy_install,
Sphinx and plasTex as above, then from the .../opencv/doc/latex2sphinx directory,
issue the "buildall" commend there:
sh buildall
The resulting html files will be be created in:
.../opencv/doc/latex2sphinx/_build/html
Under this html directory, you will find index.html files for:
cpp The C++ manual
c The C manual
py The Python manual
--------------------------------------------------------------------------
[1] To install easy install on Ubuntu, try either (as stated above):
sudo apt-get install python-setuptools
or try using:
First:
wget -q http://peak.telecommunity.com/dist/ez_setup.py
Then
sudo python ez_setup.py
......@@ -274,17 +274,30 @@ tt.descname {
font-size: 1.6em;
}
dl.cfunction {
padding-bottom: 9px;
div.math p {
margin-top: 10px;
margin-bottom: 10px;
}
dl.function > dt:first-child {
margin-bottom: 7px;
background-color: #ecf0f3;
}
dl.cfunction > dt:first-child {
margin-bottom: 7px;
border-bottom: 1px dotted black;
background-color: #ecf0f3;
}
dl.pyfunction > dt:first-child {
margin-bottom: 7px;
background-color: #ecf0f3;
}
div.math p {
margin-top: 10px;
margin-bottom: 10px;
table.field-list {
margin-top: 20px;
}
ul.simple {
list-style: none;
}
doc/acircles_pattern.png

303 KB | W: | H:

doc/acircles_pattern.png

33.7 KB | W: | H:

doc/acircles_pattern.png
doc/acircles_pattern.png
doc/acircles_pattern.png
doc/acircles_pattern.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -126,7 +126,7 @@ 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'
html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
......@@ -223,8 +223,10 @@ pngmath_latex_preamble = r"""
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('modules/refman', 'opencv2refman.tex', u'The OpenCV Reference Manual',
('modules/refman', 'opencv2refman_cpp.tex', u'The OpenCV 2.x C++ Reference Manual',
u'', 'manual'),
('doc/opencv2/py/py_index', 'opencv2refman_py.tex', u'The OpenCV 2.x Python Reference Manual',
u'', 'manual'),
('doc/opencv1/c/c_index', 'opencv1refman_c.tex', u'The OpenCV 1.x C Reference Manual',
u'', 'manual'),
('doc/opencv1/py/py_index', 'opencv1refman_py.tex', u'The OpenCV 1.x Python Reference Manual',
......
......@@ -9,7 +9,7 @@ IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
For Open Source Computer Vision Library
Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
Copyright (C) 2008-2010, Willow Garage Inc., all rights reserved.
Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved.
Third party copyrights are property of their respective owners.
Redistribution and use in source and binary forms, with or without modification,
......
This diff is collapsed.
This diff is collapsed.
......@@ -1781,6 +1781,8 @@ Difference norm between two projections is the maximal distance between correspo
``criteria.epsilon``
serves to stop the algorithm if the difference is small.
An example of using ``cvPOSIT`` and ``cvCreatePOSITObject`` is available at http://opencv.willowgarage.com/wiki/Posit
.. index:: ProjectPoints2
......
# -*- coding: utf-8 -*-
#
# opencv documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 4 21:06:43 2009.
#
# 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.append(os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# 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.doctest'] # , 'sphinx.ext.intersphinx']
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'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'opencv'
copyright = u'2010, authors'
# 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.2'
# The full version, including alpha/beta/rc tags.
release = '2.2.9'
# 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 documents that shouldn't be included in the build.
#unused_docs = []
# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_trees = ['_build']
# 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 = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
html_theme = 'blue'
# 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 = {
"lang" : "%LANG%" # buildall substitutes this for c, cpp, py
}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ['../_themes']
# 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 = '../opencv-logo2.png'
# 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_use_modindex = 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, 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 = ''
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = ''
# Output file base name for HTML help builder.
htmlhelp_basename = 'opencvdoc'
# -- 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'opencv Documentation',
u'author', 'manual'),
]
# 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
# 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_use_modindex = True
pngmath_latex_preamble = '\usepackage{mymath}\usepackage{amsmath}\usepackage{bbm}\usepackage[usenames]{color}'
# intersphinx_mapping = {
# 'http://docs.python.org/': None,
# }
intersphinx_mapping = {}
latex_elements = {'preamble': '\usepackage{mymath}\usepackage{amssymb}\usepackage{amsmath}\usepackage{bbm}'}
......@@ -7234,7 +7234,7 @@ mSet
.. cfunction:: void cvmSet(CvMat* mat, int row, int col, double value)
Returns a specific element of a single-channel floating-point matrix.
Sets a specific element of a single-channel floating-point matrix.
......
......@@ -648,13 +648,7 @@ The function can do the following transformations:
) The Bayer pattern is widely used in CCD and CMOS cameras. It allows one to get color pictures from a single plane where R,G and B pixels (sensors of a particular component) are interleaved like this:
.. math::
\newcommand{\Rcell}{\color{red}R} \newcommand{\Gcell}{\color{green}G} \newcommand{\Bcell}{\color{blue}B} \definecolor{BackGray}{rgb}{0.8,0.8,0.8} \begin{array}{ c c c c c } \Rcell & \Gcell & \Rcell & \Gcell & \Rcell \\ \Gcell & \colorbox{BackGray}{\Bcell} & \colorbox{BackGray}{\Gcell} & \Bcell & \Gcell \\ \Rcell & \Gcell & \Rcell & \Gcell & \Rcell \\ \Gcell & \Bcell & \Gcell & \Bcell & \Gcell \\ \Rcell & \Gcell & \Rcell & \Gcell & \Rcell \end{array}
.. image:: ../pics/bayer.png
The output RGB components of a pixel are interpolated from 1, 2 or
4 neighbors of the pixel having the same color. There are several
......
# -*- coding: utf-8 -*-
#
# opencv documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 4 21:06:43 2009.
#
# 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.append(os.path.abspath('.'))
# -- General configuration -----------------------------------------------------
# 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.doctest'] # , 'sphinx.ext.intersphinx']
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'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'opencv'
copyright = u'2010, authors'
# 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.2'
# The full version, including alpha/beta/rc tags.
release = '2.2.9'
# 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 documents that shouldn't be included in the build.
#unused_docs = []
# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_trees = ['_build']
# 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 = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
html_theme = 'blue'
# 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 = {
"lang" : "%LANG%" # buildall substitutes this for c, cpp, py
}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ['../_themes']
# 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 = '../opencv-logo2.png'
# 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_use_modindex = 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, 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 = ''
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = ''
# Output file base name for HTML help builder.
htmlhelp_basename = 'opencvdoc'
# -- 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'opencv Documentation',
u'author', 'manual'),
]
# 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
# 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_use_modindex = True
pngmath_latex_preamble = '\usepackage{mymath}\usepackage{amsmath}\usepackage{bbm}\usepackage[usenames]{color}'
# intersphinx_mapping = {
# 'http://docs.python.org/': None,
# }
intersphinx_mapping = {}
latex_elements = {'preamble': '\usepackage{mymath}\usepackage{amssymb}\usepackage{amsmath}\usepackage{bbm}'}
......@@ -663,14 +663,7 @@ The function can do the following transformations:
``CV_BayerBG2BGR, CV_BayerGB2BGR, CV_BayerRG2BGR, CV_BayerGR2BGR, CV_BayerBG2RGB, CV_BayerGB2RGB, CV_BayerRG2RGB, CV_BayerGR2RGB``
) The Bayer pattern is widely used in CCD and CMOS cameras. It allows one to get color pictures from a single plane where R,G and B pixels (sensors of a particular component) are interleaved like this:
.. math::
\newcommand{\Rcell}{\color{red}R} \newcommand{\Gcell}{\color{green}G} \newcommand{\Bcell}{\color{blue}B} \definecolor{BackGray}{rgb}{0.8,0.8,0.8} \begin{array}{ c c c c c } \Rcell & \Gcell & \Rcell & \Gcell & \Rcell \\ \Gcell & \colorbox{BackGray}{\Bcell} & \colorbox{BackGray}{\Gcell} & \Bcell & \Gcell \\ \Rcell & \Gcell & \Rcell & \Gcell & \Rcell \\ \Gcell & \Bcell & \Gcell & \Bcell & \Gcell \\ \Rcell & \Gcell & \Rcell & \Gcell & \Rcell \end{array}
.. image:: ../pics/bayer.png
The output RGB components of a pixel are interpolated from 1, 2 or
4 neighbors of the pixel having the same color. There are several
......
project(opencv_refman)
file(GLOB_RECURSE OPENCV2_FILES_PICT ../../modules/*.png ../../modules/*.jpg)
file(GLOB_RECURSE OPENCV2_FILES_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
${CMAKE_CURRENT_SOURCE_DIR}/../mymath.sty ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${PDFLATEX_COMPILER} opencv
COMMAND ${PDFLATEX_COMPILER} opencv
DEPENDS conf.py ${OPENCV2_FILES_RST} ${OPENCV2_FILES_PICT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating the OpenCV Reference Manual")
#install(FILES ${CURRENT_BINARY_DIR}/opencv.pdf DESTINATION "${OPENCV_DOC_INSTALL_PATH}" COMPONENT main)
*******************************************************
calib3d. Camera Calibration, Pose Estimation and Stereo
*******************************************************
.. toctree::
:maxdepth: 2
calib3d_camera_calibration_and_3d_reconstruction
Cookbook
========
.. highlight:: python
Here is a collection of code fragments demonstrating some features
of the OpenCV Python bindings.
Convert an image
----------------
.. doctest::
>>> import cv
>>> im = cv.LoadImageM("building.jpg")
>>> print type(im)
<type 'cv.cvmat'>
>>> cv.SaveImage("foo.png", im)
..
Resize an image
---------------
To resize an image in OpenCV, create a destination image of the appropriate size, then call
:ref:`Resize`
.
.. doctest::
>>> import cv
>>> original = cv.LoadImageM("building.jpg")
>>> thumbnail = cv.CreateMat(original.rows / 10, original.cols / 10, cv.CV_8UC3)
>>> cv.Resize(original, thumbnail)
..
Compute the Laplacian
---------------------
.. doctest::
>>> import cv
>>> im = cv.LoadImageM("building.jpg", 1)
>>> dst = cv.CreateImage(cv.GetSize(im), cv.IPL_DEPTH_16S, 3)
>>> laplace = cv.Laplace(im, dst)
>>> cv.SaveImage("foo-laplace.png", dst)
..
Using GoodFeaturesToTrack
-------------------------
To find the 10 strongest corner features in an image, use
:ref:`GoodFeaturesToTrack`
like this:
.. doctest::
>>> import cv
>>> img = cv.LoadImageM("building.jpg", cv.CV_LOAD_IMAGE_GRAYSCALE)
>>> eig_image = cv.CreateMat(img.rows, img.cols, cv.CV_32FC1)
>>> temp_image = cv.CreateMat(img.rows, img.cols, cv.CV_32FC1)
>>> for (x,y) in cv.GoodFeaturesToTrack(img, eig_image, temp_image, 10, 0.04, 1.0, useHarris = True):
... print "good feature at", x,y
good feature at 198.0 514.0
good feature at 791.0 260.0
good feature at 370.0 467.0
good feature at 374.0 469.0
good feature at 490.0 520.0
good feature at 262.0 278.0
good feature at 781.0 134.0
good feature at 3.0 247.0
good feature at 667.0 321.0
good feature at 764.0 304.0
..
Using GetSubRect
----------------
GetSubRect returns a rectangular part of another image. It does this without copying any data.
.. doctest::
>>> import cv
>>> img = cv.LoadImageM("building.jpg")
>>> sub = cv.GetSubRect(img, (60, 70, 32, 32)) # sub is 32x32 patch within img
>>> cv.SetZero(sub) # clear sub to zero, which also clears 32x32 pixels in img
..
Using CreateMat, and accessing an element
-----------------------------------------
.. doctest::
>>> import cv
>>> mat = cv.CreateMat(5, 5, cv.CV_32FC1)
>>> cv.Set(mat, 1.0)
>>> mat[3,1] += 0.375
>>> print mat[3,1]
1.375
>>> print [mat[3,i] for i in range(5)]
[1.0, 1.375, 1.0, 1.0, 1.0]
..
ROS image message to OpenCV
---------------------------
See this tutorial:
`Using CvBridge to convert between ROS images And OpenCV images <http://www.ros.org/wiki/cv_bridge/Tutorials/UsingCvBridgeToConvertBetweenROSImagesAndOpenCVImages>`_
.
PIL Image to OpenCV
-------------------
(For details on PIL see the
`PIL handbook <http://www.pythonware.com/library/pil/handbook/image.htm>`_
.)
.. doctest::
>>> import Image, cv
>>> pi = Image.open('building.jpg') # PIL image
>>> cv_im = cv.CreateImageHeader(pi.size, cv.IPL_DEPTH_8U, 3)
>>> cv.SetData(cv_im, pi.tostring())
>>> print pi.size, cv.GetSize(cv_im)
(868, 600) (868, 600)
>>> print pi.tostring() == cv_im.tostring()
True
..
OpenCV to PIL Image
-------------------
.. doctest::
>>> import Image, cv
>>> cv_im = cv.CreateImage((320,200), cv.IPL_DEPTH_8U, 1)
>>> pi = Image.fromstring("L", cv.GetSize(cv_im), cv_im.tostring())
>>> print pi.size
(320, 200)
..
NumPy and OpenCV
----------------
Using the
`array interface <http://docs.scipy.org/doc/numpy/reference/arrays.interface.html>`_
, to use an OpenCV CvMat in NumPy:
.. doctest::
>>> import cv, numpy
>>> mat = cv.CreateMat(3, 5, cv.CV_32FC1)
>>> cv.Set(mat, 7)
>>> a = numpy.asarray(mat)
>>> print a
[[ 7. 7. 7. 7. 7.]
[ 7. 7. 7. 7. 7.]
[ 7. 7. 7. 7. 7.]]
..
and to use a NumPy array in OpenCV:
.. doctest::
>>> import cv, numpy
>>> a = numpy.ones((480, 640))
>>> mat = cv.fromarray(a)
>>> print mat.rows
480
>>> print mat.cols
640
..
also, most OpenCV functions can work on NumPy arrays directly, for example:
.. doctest::
>>> picture = numpy.ones((640, 480))
>>> cv.Smooth(picture, picture, cv.CV_GAUSSIAN, 15, 15)
..
Given a 2D array,
the
:ref:`fromarray`
function (or the implicit version shown above)
returns a single-channel
:ref:`CvMat`
of the same size.
For a 3D array of size
:math:`j \times k \times l`
, it returns a
:ref:`CvMat`
sized
:math:`j \times k`
with
:math:`l`
channels.
Alternatively, use
:ref:`fromarray`
with the
``allowND``
option to always return a
:ref:`cvMatND`
.
OpenCV to pygame
----------------
To convert an OpenCV image to a
`pygame <http://www.pygame.org/>`_
surface:
.. doctest::
>>> import pygame.image, cv
>>> src = cv.LoadImage("lena.jpg")
>>> src_rgb = cv.CreateMat(src.height, src.width, cv.CV_8UC3)
>>> cv.CvtColor(src, src_rgb, cv.CV_BGR2RGB)
>>> pg_img = pygame.image.frombuffer(src_rgb.tostring(), cv.GetSize(src_rgb), "RGB")
>>> print pg_img
<Surface(512x512x24 SW)>
..
OpenCV and OpenEXR
------------------
Using
`OpenEXR's Python bindings <http://www.excamera.com/sphinx/articles-openexr.html>`_
you can make a simple
image viewer:
::
import OpenEXR, Imath, cv
filename = "GoldenGate.exr"
exrimage = OpenEXR.InputFile(filename)
dw = exrimage.header()['dataWindow']
(width, height) = (dw.max.x - dw.min.x + 1, dw.max.y - dw.min.y + 1)
def fromstr(s):
mat = cv.CreateMat(height, width, cv.CV_32FC1)
cv.SetData(mat, s)
return mat
pt = Imath.PixelType(Imath.PixelType.FLOAT)
(r, g, b) = [fromstr(s) for s in exrimage.channels("RGB", pt)]
bgr = cv.CreateMat(height, width, cv.CV_32FC3)
cv.Merge(b, g, r, None, bgr)
cv.ShowImage(filename, bgr)
cv.WaitKey()
..
****************************
core. The Core Functionality
****************************
.. toctree::
:maxdepth: 2
core_basic_structures
core_operations_on_arrays
core_dynamic_structures
core_drawing_functions
core_xml_yaml_persistence
core_clustering
core_utility_and_system_functions_and_macros
Basic Structures
================
.. highlight:: python
.. index:: CvPoint
.. _CvPoint:
CvPoint
-------
.. class:: CvPoint
2D point with integer coordinates (usually zero-based).
2D point, represented as a tuple
``(x, y)``
, where x and y are integers.
.. index:: CvPoint2D32f
.. _CvPoint2D32f:
CvPoint2D32f
------------
.. class:: CvPoint2D32f
2D point with floating-point coordinates
2D point, represented as a tuple
``(x, y)``
, where x and y are floats.
.. index:: CvPoint3D32f
.. _CvPoint3D32f:
CvPoint3D32f
------------
.. class:: CvPoint3D32f
3D point with floating-point coordinates
3D point, represented as a tuple
``(x, y, z)``
, where x, y and z are floats.
.. index:: CvPoint2D64f
.. _CvPoint2D64f:
CvPoint2D64f
------------
.. class:: CvPoint2D64f
2D point with double precision floating-point coordinates
2D point, represented as a tuple
``(x, y)``
, where x and y are floats.
.. index:: CvPoint3D64f
.. _CvPoint3D64f:
CvPoint3D64f
------------
.. class:: CvPoint3D64f
3D point with double precision floating-point coordinates
3D point, represented as a tuple
``(x, y, z)``
, where x, y and z are floats.
.. index:: CvSize
.. _CvSize:
CvSize
------
.. class:: CvSize
Pixel-accurate size of a rectangle.
Size of a rectangle, represented as a tuple
``(width, height)``
, where width and height are integers.
.. index:: CvSize2D32f
.. _CvSize2D32f:
CvSize2D32f
-----------
.. class:: CvSize2D32f
Sub-pixel accurate size of a rectangle.
Size of a rectangle, represented as a tuple
``(width, height)``
, where width and height are floats.
.. index:: CvRect
.. _CvRect:
CvRect
------
.. class:: CvRect
Offset (usually the top-left corner) and size of a rectangle.
Rectangle, represented as a tuple
``(x, y, width, height)``
, where all are integers.
.. index:: CvScalar
.. _CvScalar:
CvScalar
--------
.. class:: CvScalar
A container for 1-,2-,3- or 4-tuples of doubles.
CvScalar is always represented as a 4-tuple.
.. doctest::
>>> import cv
>>> cv.Scalar(1, 2, 3, 4)
(1.0, 2.0, 3.0, 4.0)
>>> cv.ScalarAll(7)
(7.0, 7.0, 7.0, 7.0)
>>> cv.RealScalar(7)
(7.0, 0.0, 0.0, 0.0)
>>> cv.RGB(17, 110, 255)
(255.0, 110.0, 17.0, 0.0)
..
.. index:: CvTermCriteria
.. _CvTermCriteria:
CvTermCriteria
--------------
.. class:: CvTermCriteria
Termination criteria for iterative algorithms.
Represented by a tuple
``(type, max_iter, epsilon)``
.
.. attribute:: type
``CV_TERMCRIT_ITER`` , ``CV_TERMCRIT_EPS`` or ``CV_TERMCRIT_ITER | CV_TERMCRIT_EPS``
.. attribute:: max_iter
Maximum number of iterations
.. attribute:: epsilon
Required accuracy
::
(cv.CV_TERMCRIT_ITER, 10, 0) # terminate after 10 iterations
(cv.CV_TERMCRIT_EPS, 0, 0.01) # terminate when epsilon reaches 0.01
(cv.CV_TERMCRIT_ITER | cv.CV_TERMCRIT_EPS, 10, 0.01) # terminate as soon as either condition is met
..
.. index:: CvMat
.. _CvMat:
CvMat
-----
.. class:: CvMat
A multi-channel 2D matrix. Created by
:ref:`CreateMat`
,
:ref:`LoadImageM`
,
:ref:`CreateMatHeader`
,
:ref:`fromarray`
.
.. attribute:: type
A CvMat signature containing the type of elements and flags, int
.. attribute:: step
Full row length in bytes, int
.. attribute:: rows
Number of rows, int
.. attribute:: cols
Number of columns, int
.. method:: tostring() -> str
Returns the contents of the CvMat as a single string.
.. index:: CvMatND
.. _CvMatND:
CvMatND
-------
.. class:: CvMatND
Multi-dimensional dense multi-channel array.
.. attribute:: type
A CvMatND signature combining the type of elements and flags, int
.. method:: tostring() -> str
Returns the contents of the CvMatND as a single string.
.. index:: IplImage
.. _IplImage:
IplImage
--------
.. class:: IplImage
The
:ref:`IplImage`
object was inherited from the Intel Image Processing
Library, in which the format is native. OpenCV only supports a subset
of possible
:ref:`IplImage`
formats.
.. attribute:: nChannels
Number of channels, int.
.. attribute:: width
Image width in pixels
.. attribute:: height
Image height in pixels
.. attribute:: depth
Pixel depth in bits. The supported depths are:
.. attribute:: IPL_DEPTH_8U
Unsigned 8-bit integer
.. attribute:: IPL_DEPTH_8S
Signed 8-bit integer
.. attribute:: IPL_DEPTH_16U
Unsigned 16-bit integer
.. attribute:: IPL_DEPTH_16S
Signed 16-bit integer
.. attribute:: IPL_DEPTH_32S
Signed 32-bit integer
.. attribute:: IPL_DEPTH_32F
Single-precision floating point
.. attribute:: IPL_DEPTH_64F
Double-precision floating point
.. attribute:: origin
0 - top-left origin, 1 - bottom-left origin (Windows bitmap style)
.. method:: tostring() -> str
Returns the contents of the CvMatND as a single string.
.. index:: CvArr
.. _CvArr:
CvArr
-----
.. class:: CvArr
Arbitrary array
``CvArr``
is used
*only*
as a function parameter to specify that the parameter can be:
* an :ref:`IplImage`
* a :ref:`CvMat`
* any other type that exports the `array interface <http://docs.scipy.org/doc/numpy/reference/arrays.interface.html>`_
Clustering
==========
.. highlight:: python
.. index:: KMeans2
.. _KMeans2:
KMeans2
-------
.. function:: KMeans2(samples,nclusters,labels,termcrit)-> None
Splits set of vectors by a given number of clusters.
:param samples: Floating-point matrix of input samples, one row per sample
:type samples: :class:`CvArr`
:param nclusters: Number of clusters to split the set by
:type nclusters: int
:param labels: Output integer vector storing cluster indices for every sample
:type labels: :class:`CvArr`
:param termcrit: Specifies maximum number of iterations and/or accuracy (distance the centers can move by between subsequent iterations)
:type termcrit: :class:`CvTermCriteria`
The function
``cvKMeans2``
implements a k-means algorithm that finds the
centers of
``nclusters``
clusters and groups the input samples
around the clusters. On output,
:math:`\texttt{labels}_i`
contains a cluster index for
samples stored in the i-th row of the
``samples``
matrix.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Utility and System Functions and Macros
=======================================
.. highlight:: python
Error Handling
--------------
Errors in argument type cause a
``TypeError``
exception.
OpenCV errors cause an
``cv.error``
exception.
For example a function argument that is the wrong type produces a
``TypeError``
:
.. doctest::
>>> import cv
>>> cv.LoadImage(4)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: argument 1 must be string, not int
..
A function with the
.. doctest::
>>> cv.CreateMat(-1, -1, cv.CV_8UC1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
error: Non-positive width or height
..
.. index:: GetTickCount
.. _GetTickCount:
GetTickCount
------------
.. function:: GetTickCount() -> long
Returns the number of ticks.
The function returns number of the ticks starting from some platform-dependent event (number of CPU ticks from the startup, number of milliseconds from 1970th year, etc.). The function is useful for accurate measurement of a function/user-code execution time. To convert the number of ticks to time units, use
:ref:`GetTickFrequency`
.
.. index:: GetTickFrequency
.. _GetTickFrequency:
GetTickFrequency
----------------
.. function:: GetTickFrequency() -> long
Returns the number of ticks per microsecond.
The function returns the number of ticks per microsecond. Thus, the quotient of
:ref:`GetTickCount`
and
:ref:`GetTickFrequency`
will give the number of microseconds starting from the platform-dependent event.
This diff is collapsed.
*******************************************************
features2d. Feature Detection and Descriptor Extraction
*******************************************************
.. toctree::
:maxdepth: 2
features2d_feature_detection_and_description
*************************************
highgui. High-level GUI and Media I/O
*************************************
While OpenCV was designed for use in full-scale
applications and can be used within functionally rich UI frameworks (such as Qt, WinForms or Cocoa) or without any UI at all, sometimes there is a need to try some functionality quickly and visualize the results. This is what the HighGUI module has been designed for.
It provides easy interface to:
*
create and manipulate windows that can display images and "remember" their content (no need to handle repaint events from OS)
*
add trackbars to the windows, handle simple mouse events as well as keyboard commmands
*
read and write images to/from disk or memory.
*
read video from camera or file and write video to a file.
.. toctree::
:maxdepth: 2
highgui_user_interface
highgui_reading_and_writing_images_and_video
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.
***************************
objdetect. Object Detection
***************************
.. toctree::
:maxdepth: 2
objdetect_cascade_classification
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
No preview for this file type
No preview for this file type
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.
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.
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.
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.
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