Commit 5c3447c1 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

added pictures for OpenCV 2.x reference manual; fixed some build problems and…

added pictures for OpenCV 2.x reference manual; fixed some build problems and done some more cleanup work
parent 7f83ea1b
Camera Calibration and 3D Reconstruction Camera Calibration and 3D Reconstruction
======================================== ========================================
.. highlight:: cpp
The functions in this section use the so-called pinhole camera model. That The functions in this section use the so-called pinhole camera model. That
is, a scene view is formed by projecting 3D points into the image plane is, a scene view is formed by projecting 3D points into the image plane
using a perspective transformation. using a perspective transformation.
...@@ -15,8 +13,7 @@ or ...@@ -15,8 +13,7 @@ or
.. math:: .. math::
s \vecthree{u}{v}{1} = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1} s \vecthree{u}{v}{1} = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}
\begin{bmatrix} \begin{bmatrix}
r_{11} & r_{12} & r_{13} & t_1 \\ r_{11} & r_{12} & r_{13} & t_1 \\
r_{21} & r_{22} & r_{23} & t_2 \\ r_{21} & r_{22} & r_{23} & t_2 \\
......
...@@ -7,7 +7,6 @@ core. The Core Functionality ...@@ -7,7 +7,6 @@ core. The Core Functionality
basic_structures basic_structures
operations_on_arrays operations_on_arrays
dynamic_structures
drawing_functions drawing_functions
xml_yaml_persistence xml_yaml_persistence
clustering clustering
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
Introduction Introduction
************ ************
.. highlight:: cpp
OpenCV (Open Source Computer Vision Library: http://opencv.willowgarage.com/wiki/) is open-source BSD-licensed library that includes several hundreds computer vision algorithms. It is very popular in the Computer Vision community. Some people call it “de-facto standard” API. The document aims to specify the stable parts of the library, as well as some abstract interfaces for high-level interfaces, with the final goal to make it an official standard. OpenCV (Open Source Computer Vision Library: http://opencv.willowgarage.com/wiki/) is open-source BSD-licensed library that includes several hundreds computer vision algorithms. It is very popular in the Computer Vision community. Some people call it “de-facto standard” API. The document aims to specify the stable parts of the library, as well as some abstract interfaces for high-level interfaces, with the final goal to make it an official standard.
API specifications in the document use the standard C++ (http://www.open-std.org/jtc1/sc22/wg21/) and the standard C++ library. API specifications in the document use the standard C++ (http://www.open-std.org/jtc1/sc22/wg21/) and the standard C++ library.
......
Common Interfaces of Feature Detectors Common Interfaces of Feature Detectors
====================================== ======================================
.. highlight:: cpp
Feature detectors in OpenCV have wrappers with common interface that enables to switch easily Feature detectors in OpenCV have wrappers with common interface that enables to switch easily
between different algorithms solving the same problem. All objects that implement keypoint detectors between different algorithms solving the same problem. All objects that implement keypoint detectors
inherit inherit
...@@ -1005,11 +1003,10 @@ AdjusterAdapter::good ...@@ -1005,11 +1003,10 @@ AdjusterAdapter::good
Are params maxed out or still valid? Returns false if the parameters can't be adjusted any more. An example implementation of this is :: Are params maxed out or still valid? Returns false if the parameters can't be adjusted any more. An example implementation of this is ::
bool FastAdjuster::good() const bool FastAdjuster::good() const
{ {
return (thresh_ > 1) && (thresh_ < 200); return (thresh > 1) && (thresh < 200);
} }
.. index:: FastAdjuster .. index:: FastAdjuster
......
...@@ -14,21 +14,11 @@ There are descriptors such as One way descriptor and Ferns that have ``GenericDe ...@@ -14,21 +14,11 @@ There are descriptors such as One way descriptor and Ferns that have ``GenericDe
.. index:: GenericDescriptorMatcher .. index:: GenericDescriptorMatcher
.. _GenericDescriptorMatcher:
GenericDescriptorMatcher GenericDescriptorMatcher
------------------------ ------------------------
.. c:type:: GenericDescriptorMatcher .. c:type:: GenericDescriptorMatcher
Abstract interface for a keypoint descriptor extracting and matching. Abstract interface for a keypoint descriptor extracting and matching. There is :func:`DescriptorExtractor` and :func:`DescriptorMatcher` for these purposes too, but their interfaces are intended for descriptors represented as vectors in a multidimensional space. ``GenericDescriptorMatcher`` is a more generic interface for descriptors. :func:`DescriptorMatcher`,``GenericDescriptorMatcher`` has two groups of match methods: for matching keypoints of one image with other image or with image set. ::
There is
:func:`DescriptorExtractor` and
:func:`DescriptorMatcher` for these purposes too, but their interfaces are intended for descriptors
represented as vectors in a multidimensional space. ``GenericDescriptorMatcher`` is a more generic interface for descriptors.
:func:`DescriptorMatcher`,``GenericDescriptorMatcher`` has two groups
of match methods: for matching keypoints of one image with other image or
with image set. ::
class GenericDescriptorMatcher class GenericDescriptorMatcher
{ {
......
Drawing Function of Keypoints and Matches Drawing Function of Keypoints and Matches
========================================= =========================================
.. highlight:: cpp
.. index:: drawMatches .. index:: drawMatches
drawMatches drawMatches
--------------- ---------------
.. c:function:: void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1, const Mat& img2, const vector<KeyPoint>& keypoints2, const vector<DMatch>& matches1to2, Mat& outImg, const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1), const vector<char>& matchesMask=vector<char>(), int flags=DrawMatchesFlags::DEFAULT )
This function draws matches of keypints from two images on output image. Match is a line connecting two keypoints (circles). .. c:function:: void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1, const Mat& img2, const vector<KeyPoint>& keypoints2, const vector<DMatch>& matches1to2, Mat& outImg, const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1), const vector<char>& matchesMask=vector<char>(), int flags=DrawMatchesFlags::DEFAULT )
.. c:function:: void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1, const Mat& img2, const vector<KeyPoint>& keypoints2, const vector<vector<DMatch> >& matches1to2, Mat& outImg, const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1), const vector<vector<char>>& matchesMask= vector<vector<char> >(), int flags=DrawMatchesFlags::DEFAULT ) .. c:function:: void drawMatches( const Mat& img1, const vector<KeyPoint>& keypoints1, const Mat& img2, const vector<KeyPoint>& keypoints2, const vector<vector<DMatch> >& matches1to2, Mat& outImg, const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1), const vector<vector<char>>& matchesMask= vector<vector<char> >(), int flags=DrawMatchesFlags::DEFAULT )
...@@ -31,29 +28,34 @@ drawMatches ...@@ -31,29 +28,34 @@ drawMatches
:param matchesMask: Mask determining which matches will be drawn. If mask is empty all matches will be drawn. :param matchesMask: Mask determining which matches will be drawn. If mask is empty all matches will be drawn.
:param flags: Each bit of ``flags`` sets some feature of drawing. Possible ``flags`` bit values is defined by ``DrawMatchesFlags`` :: :param flags: Each bit of ``flags`` sets some feature of drawing. Possible ``flags`` bit values is defined by ``DrawMatchesFlags``.
struct DrawMatchesFlags This function draws matches of keypints from two images on output image. Match is a line connecting two keypoints (circles). The structure ``DrawMatchesFlags`` is defined as follows:
{
enum{ DEFAULT = 0, // Output image matrix will be created (Mat::create), .. code-block:: cpp
// i.e. existing memory of output image may be reused.
// Two source image, matches and single keypoints struct DrawMatchesFlags
// will be drawn. {
// For each keypoint only the center point will be enum
// drawn (without the circle around keypoint with {
// keypoint size and orientation). DEFAULT = 0, // Output image matrix will be created (Mat::create),
DRAW_OVER_OUTIMG = 1, // Output image matrix will not be // i.e. existing memory of output image may be reused.
// created (Mat::create). Matches will be drawn // Two source image, matches and single keypoints
// on existing content of output image. // will be drawn.
NOT_DRAW_SINGLE_POINTS = 2, // Single keypoints will not be drawn. // For each keypoint only the center point will be
DRAW_RICH_KEYPOINTS = 4 // For each keypoint the circle around // drawn (without the circle around keypoint with
// keypoint with keypoint size and orientation will // keypoint size and orientation).
// be drawn. DRAW_OVER_OUTIMG = 1, // Output image matrix will not be
}; // created (using Mat::create). Matches will be drawn
}; // on existing content of output image.
NOT_DRAW_SINGLE_POINTS = 2, // Single keypoints will not be drawn.
.. DRAW_RICH_KEYPOINTS = 4 // For each keypoint the circle around
// keypoint with keypoint size and orientation will
// be drawn.
};
};
..
.. index:: drawKeypoints .. index:: drawKeypoints
......
...@@ -9,7 +9,7 @@ gpu. GPU-accelerated Computer Vision ...@@ -9,7 +9,7 @@ gpu. GPU-accelerated Computer Vision
initalization_and_information initalization_and_information
data_structures data_structures
operations_on_matrices operations_on_matrices
per_element_operations. per_element_operations
image_processing image_processing
matrix_reductions matrix_reductions
object_detection object_detection
......
This diff is collapsed.
Qt new functions Qt new functions
================ ================
.. highlight:: cpp .. image:: pics/qtgui.png
.. image:: ../../pics/Qt_GUI.png
This figure explains the new functionalities implemented with Qt GUI. As we can see, the new GUI provides a statusbar, a toolbar, and a control panel. The control panel can have trackbars and buttonbars attached to it. This figure explains the new functionalities implemented with Qt GUI. As we can see, the new GUI provides a statusbar, a toolbar, and a control panel. The control panel can have trackbars and buttonbars attached to it.
......
Feature Detection Feature Detection
================= =================
.. highlight:: cpp
.. index:: Canny .. index:: Canny
Canny Canny
...@@ -146,7 +144,7 @@ cornerSubPix ...@@ -146,7 +144,7 @@ cornerSubPix
The function iterates to find the sub-pixel accurate location of corners, or radial saddle points, as shown in on the picture below. The function iterates to find the sub-pixel accurate location of corners, or radial saddle points, as shown in on the picture below.
.. image:: ../../pics/cornersubpix.png .. image:: pics/cornersubpix.png
Sub-pixel accurate corner locator is based on the observation that every vector from the center Sub-pixel accurate corner locator is based on the observation that every vector from the center
:math:`q` to a point :math:`q` to a point
...@@ -408,11 +406,11 @@ Matas00 ...@@ -408,11 +406,11 @@ Matas00
This is the sample picture the function parameters have been tuned for: This is the sample picture the function parameters have been tuned for:
.. image:: ../../pics/building.jpg .. image:: pics/building.jpg
And this is the output of the above program in the case of probabilistic Hough transform And this is the output of the above program in the case of probabilistic Hough transform
.. image:: ../../pics/houghp.png .. image:: pics/houghp.png
.. index:: preCornerDetect .. index:: preCornerDetect
......
Image Filtering Image Filtering
=============== ===============
.. highlight:: cpp
Functions and classes described in this section are used to perform various linear or non-linear filtering operations on 2D images (represented as Functions and classes described in this section are used to perform various linear or non-linear filtering operations on 2D images (represented as
:func:`Mat` 's), that is, for each pixel location :func:`Mat` 's), that is, for each pixel location
:math:`(x,y)` in the source image some its (normally rectangular) neighborhood is considered and used to compute the response. In case of a linear filter it is a weighted sum of pixel values, in case of morphological operations it is the minimum or maximum etc. The computed response is stored to the destination image at the same location :math:`(x,y)` in the source image some its (normally rectangular) neighborhood is considered and used to compute the response. In case of a linear filter it is a weighted sum of pixel values, in case of morphological operations it is the minimum or maximum etc. The computed response is stored to the destination image at the same location
......
Geometric Image Transformations Geometric Image Transformations
=============================== ===============================
.. highlight:: cpp
The functions in this section perform various geometrical transformations of 2D images. That is, they do not change the image content, but deform the pixel grid, and map this deformed grid to the destination image. In fact, to avoid sampling artifacts, the mapping is done in the reverse order, from destination to the source. That is, for each pixel The functions in this section perform various geometrical transformations of 2D images. That is, they do not change the image content, but deform the pixel grid, and map this deformed grid to the destination image. In fact, to avoid sampling artifacts, the mapping is done in the reverse order, from destination to the source. That is, for each pixel
:math:`(x, y)` of the destination image, the functions compute coordinates of the corresponding "donor" pixel in the source image and copy the pixel value, that is: :math:`(x, y)` of the destination image, the functions compute coordinates of the corresponding "donor" pixel in the source image and copy the pixel value, that is:
......
Histograms Histograms
========== ==========
.. highlight:: cpp
.. index:: calcHist .. index:: calcHist
calcHist calcHist
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
imgproc. Image Processing imgproc. Image Processing
************************* *************************
.. highlight:: cpp
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
...@@ -10,7 +12,6 @@ imgproc. Image Processing ...@@ -10,7 +12,6 @@ imgproc. Image Processing
miscellaneous_transformations miscellaneous_transformations
histograms histograms
structural_analysis_and_shape_descriptors structural_analysis_and_shape_descriptors
planar_subdivisions
motion_analysis_and_object_tracking motion_analysis_and_object_tracking
feature_detection feature_detection
object_detection object_detection
Miscellaneous Image Transformations Miscellaneous Image Transformations
=================================== ===================================
.. highlight:: cpp
.. index:: adaptiveThreshold .. index:: adaptiveThreshold
adaptiveThreshold adaptiveThreshold
...@@ -616,7 +614,7 @@ As a practical example, the next figure shows the calculation of the integral of ...@@ -616,7 +614,7 @@ As a practical example, the next figure shows the calculation of the integral of
\begin{center} \begin{center}
.. image:: ../../pics/integral.png .. image:: pics/integral.png
\end{center} \end{center}
...@@ -682,7 +680,7 @@ value using Otsu's algorithm and uses it instead of the specified ``thresh`` . ...@@ -682,7 +680,7 @@ value using Otsu's algorithm and uses it instead of the specified ``thresh`` .
The function returns the computed threshold value. The function returns the computed threshold value.
Currently, Otsu's method is implemented only for 8-bit images. Currently, Otsu's method is implemented only for 8-bit images.
.. image:: ../../pics/threshold.png .. image:: pics/threshold.png
See also: See also:
:func:`adaptiveThreshold`,:func:`findContours`,:func:`compare`,:func:`min`,:func:`max` :func:`adaptiveThreshold`,:func:`findContours`,:func:`compare`,:func:`min`,:func:`max`
......
Motion Analysis and Object Tracking Motion Analysis and Object Tracking
=================================== ===================================
.. highlight:: cpp
.. index:: accumulate .. index:: accumulate
accumulate accumulate
......
Object Detection Object Detection
================ ================
.. highlight:: cpp
.. index:: matchTemplate .. index:: matchTemplate
matchTemplate matchTemplate
......
Structural Analysis and Shape Descriptors Structural Analysis and Shape Descriptors
========================================= =========================================
.. highlight:: cpp
.. index:: moments .. index:: moments
moments moments
...@@ -572,5 +570,5 @@ edge. ...@@ -572,5 +570,5 @@ edge.
Here is the sample output of the function, where each image pixel is tested against the contour. Here is the sample output of the function, where each image pixel is tested against the contour.
.. image:: ../../pics/pointpolygon.png .. image:: pics/pointpolygon.png
...@@ -8,6 +8,8 @@ Welcome to opencvstd's documentation! ...@@ -8,6 +8,8 @@ Welcome to opencvstd's documentation!
Contents: Contents:
.. highlight:: cpp
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
......
Boosting Boosting
======== ========
.. highlight:: cpp
A common machine learning task is supervised learning. In supervised learning, the goal is to learn the functional relationship A common machine learning task is supervised learning. In supervised learning, the goal is to learn the functional relationship
:math:`F: y = F(x)` between the input :math:`F: y = F(x)` between the input
:math:`x` and the output :math:`x` and the output
......
Decision Trees Decision Trees
============== ==============
.. highlight:: cpp
The ML classes discussed in this section implement Classification And Regression Tree algorithms, which are described in `[Breiman84] <#paper_Breiman84>`_ The ML classes discussed in this section implement Classification And Regression Tree algorithms, which are described in `[Breiman84] <#paper_Breiman84>`_
. .
......
Expectation-Maximization Expectation-Maximization
======================== ========================
.. highlight:: cpp
The EM (Expectation-Maximization) algorithm estimates the parameters of the multivariate probability density function in the form of a Gaussian mixture distribution with a specified number of mixtures. The EM (Expectation-Maximization) algorithm estimates the parameters of the multivariate probability density function in the form of a Gaussian mixture distribution with a specified number of mixtures.
Consider the set of the feature vectors Consider the set of the feature vectors
......
K Nearest Neighbors K Nearest Neighbors
=================== ===================
.. highlight:: cpp
The algorithm caches all of the training samples, and predicts the response for a new sample by analyzing a certain number ( The algorithm caches all of the training samples, and predicts the response for a new sample by analyzing a certain number (
**K** **K**
) of the nearest neighbors of the sample (using voting, calculating weighted sum etc.) The method is sometimes referred to as "learning by example", because for prediction it looks for the feature vector with a known response that is closest to the given vector. ) of the nearest neighbors of the sample (using voting, calculating weighted sum etc.) The method is sometimes referred to as "learning by example", because for prediction it looks for the feature vector with a known response that is closest to the given vector.
......
Neural Networks Neural Networks
=============== ===============
.. highlight:: cpp
ML implements feed-forward artificial neural networks, more particularly, multi-layer perceptrons (MLP), the most commonly used type of neural networks. MLP consists of the input layer, output layer and one or more hidden layers. Each layer of MLP includes one or more neurons that are directionally linked with the neurons from the previous and the next layer. Here is an example of a 3-layer perceptron with 3 inputs, 2 outputs and the hidden layer including 5 neurons: ML implements feed-forward artificial neural networks, more particularly, multi-layer perceptrons (MLP), the most commonly used type of neural networks. MLP consists of the input layer, output layer and one or more hidden layers. Each layer of MLP includes one or more neurons that are directionally linked with the neurons from the previous and the next layer. Here is an example of a 3-layer perceptron with 3 inputs, 2 outputs and the hidden layer including 5 neurons:
.. image:: ../../pics/mlp_.png .. image:: pics/mlp.png
All the neurons in MLP are similar. Each of them has several input links (i.e. it takes the output values from several neurons in the previous layer on input) and several output links (i.e. it passes the response to several neurons in the next layer). The values retrieved from the previous layer are summed with certain weights, individual for each neuron, plus the bias term, and the sum is transformed using the activation function All the neurons in MLP are similar. Each of them has several input links (i.e. it takes the output values from several neurons in the previous layer on input) and several output links (i.e. it passes the response to several neurons in the next layer). The values retrieved from the previous layer are summed with certain weights, individual for each neuron, plus the bias term, and the sum is transformed using the activation function
:math:`f` that may be also different for different neurons. Here is the picture: :math:`f` that may be also different for different neurons. Here is the picture:
.. image:: ../../pics/neuron_model.png .. image:: pics/neuron_model.png
In other words, given the outputs In other words, given the outputs
:math:`x_j` of the layer :math:`x_j` of the layer
...@@ -36,7 +34,7 @@ Different activation functions may be used, ML implements 3 standard ones: ...@@ -36,7 +34,7 @@ Different activation functions may be used, ML implements 3 standard ones:
:math:`f(x)=\beta*(1-e^{-\alpha x})/(1+e^{-\alpha x}` ), the default choice for MLP; the standard sigmoid with :math:`f(x)=\beta*(1-e^{-\alpha x})/(1+e^{-\alpha x}` ), the default choice for MLP; the standard sigmoid with
:math:`\beta =1, \alpha =1` is shown below: :math:`\beta =1, \alpha =1` is shown below:
.. image:: ../../pics/sigmoid_bipolar.png .. image:: pics/sigmoid_bipolar.png
* *
Gaussian function ( ``CvANN_MLP::GAUSSIAN`` ): Gaussian function ( ``CvANN_MLP::GAUSSIAN`` ):
......
...@@ -9,8 +9,6 @@ This is a simple classification model assuming that feature vectors from each cl ...@@ -9,8 +9,6 @@ This is a simple classification model assuming that feature vectors from each cl
.. index:: CvNormalBayesClassifier .. index:: CvNormalBayesClassifier
.. _CvNormalBayesClassifier:
CvNormalBayesClassifier CvNormalBayesClassifier
----------------------- -----------------------
.. c:type:: CvNormalBayesClassifier .. c:type:: CvNormalBayesClassifier
......
...@@ -5,8 +5,6 @@ Statistical Models ...@@ -5,8 +5,6 @@ Statistical Models
.. index:: CvStatModel .. index:: CvStatModel
.. _CvStatModel:
CvStatModel CvStatModel
----------- -----------
.. c:type:: CvStatModel .. c:type:: CvStatModel
......
...@@ -5,8 +5,6 @@ Cascade Classification ...@@ -5,8 +5,6 @@ Cascade Classification
.. index:: FeatureEvaluator .. index:: FeatureEvaluator
.. _FeatureEvaluator:
FeatureEvaluator FeatureEvaluator
---------------- ----------------
.. c:type:: FeatureEvaluator .. c:type:: FeatureEvaluator
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
objdetect. Object Detection objdetect. Object Detection
*************************** ***************************
.. highlight:: cpp
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
......
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