@@ -16,7 +16,7 @@ Today it is common to have a digital video recording system at your disposal. Th
The source code
===============
As a test case where to show off these using OpenCV I've created a small program that reads in two video files and performs a similarity check between them. This is something you could use to check just how well a new video compressing algorithms works. Let there be a reference (original) video like :download:`this small Megamind clip <../../../../samples/cpp/tutorial_code/highgui/video-input-psnr-ssim/video/Megamind.avi>` and :download:`a compressed version of it <../../../../samples/cpp/tutorial_code/highgui/video-input-psnr-ssim/video/Megamind_bugy.avi>`. You may also find the source code and these video file in the :file:`samples/cpp/tutorial_code/highgui/video-input-psnr-ssim/` folder of the OpenCV source library.
As a test case where to show off these using OpenCV I've created a small program that reads in two video files and performs a similarity check between them. This is something you could use to check just how well a new video compressing algorithms works. Let there be a reference (original) video like :download:`this small Megamind clip <../../../../samples/cpp/tutorial_code/HighGUI/video-input-psnr-ssim/video/Megamind.avi>` and :download:`a compressed version of it <../../../../samples/cpp/tutorial_code/HighGUI/video-input-psnr-ssim/video/Megamind_bugy.avi>`. You may also find the source code and these video file in the :file:`samples/cpp/tutorial_code/HighGUI/video-input-psnr-ssim/` folder of the OpenCV source library.
.. _videoWriteHighGui:
Creating a video with OpenCV
****************************
Goal
====
Whenever you work with video feeds you may eventually want to save your image processing result in a form of a new video file. For simple video outputs you can use the OpenCV built-in :huivideo:`VideoWriter <videowriter-videowriter>` class, designed for this.
.. container:: enumeratevisibleitemswithsquare
+ How to create a video file with OpenCV
+ What type of video files you can create with OpenCV
+ How to extract a given color channel from a video
As a simple demonstration I'll just extract one of the RGB color channels of an input video file into a new video. You can control the flow of the application from its console line arguments:
.. container:: enumeratevisibleitemswithsquare
+ The first argument points to the video file to work on
+ The second argument may be one of the characters: R G B. This will specify which of the channels to extract.
+ The last argument is the character Y (Yes) or N (No). If this is no, the codec used for the input video file will be the same as for the output. Otherwise, a window will pop up and allow you to select yourself the codec to use.
For example, a valid command line would look like:
.. code-block:: bash
video-write.exe video/Megamind.avi R Y
The source code
===============
You may also find the source code and these video file in the :file:`samples/cpp/tutorial_code/highgui/video-write/` folder of the OpenCV source library or :download:`download it from here <../../../../samples/cpp/tutorial_code/HighGUI/video-write/video-write.cpp>`.
.. literalinclude:: ../../../../samples/cpp/tutorial_code/HighGUI/video-write/video-write.cpp
:language: cpp
:linenos:
:tab-width: 4
:lines: 1-8, 21-22, 24-97
The structure of a video
========================
For start, you should have an idea of just how a video file looks. Every video file in itself is a container. The type of the container is expressed in the files extension (for example *avi*, *mov* or *mkv*). This contains multiple elements like: video feeds, audio feeds or other tracks (like for example subtitles). How these feeds are stored is determined by the codec used for each one of them. In case of the audio tracks commonly used codecs are *mp3* or *aac*. For the video files the list is somehow longer and includes names such as *XVID*, *DIVX*, *H264* or *LAGS* (*Lagarith Lossless Codec*). The full list of codecs you may use on a system depends on just what one you have installed.
.. image:: images/videoFileStructure.png
:alt: The Structure of the video
:align: center
As you can see things can get really complicated with videos. However, OpenCV is mainly a computer vision library, not a video stream, codec and write one. Therefore, the developers tried to keep this part as simple as possible. Due to this OpenCV for video containers supports only the *avi* extension, its first version. A direct limitation of this is that you cannot save a video file larger than 2 GB. Furthermore you can only create and expand a single video track inside the container. No audio or other track editing support here. Nevertheless, any video codec present on your system might work. If you encounter some of these limitations you will need to look into more specialized video writing libraries such as *FFMpeg* or codecs as *HuffYUV*, *CorePNG* and *LCL*. As an alternative, create the video track with OpenCV and expand it with sound tracks or convert it to other formats by using video manipulation programs such as *VirtualDub* or *AviSynth*.
The *VideoWriter* class
=======================
The content written here builds on the assumption you already read the :ref:`videoInputPSNRMSSIM` tutorial and you know how to read video files.
To create a video file you just need to create an instance of the :huivideo:`VideoWriter <videowriter-videowriter>` class. You can specify its properties either via parameters in the constructor or later on via the :huivideo:`open <videowriter-open>` function. Either way, the parameters are the same:
1. The name of the output that contains the container type in its extension. At the moment only *avi* is supported. We construct this from the input file, add to this the name of the channel to use, and finish it off with the container extension.
.. code-block:: cpp
const string source = argv[1]; // the source file name
string::size_type pAt = source.find_last_of('.'); // Find extension point
const string NAME = source.substr(0, pAt) + argv[2][0] + ".avi"; // Form the new name with container
#. The codec to use for the video track. Now all the video codecs have a unique short name of maximum four characters. Hence, the *XVID*, *DIVX* or *H264* names. This is called a four character code. You may also ask this from an input video by using its *get* function. Because the *get* function is a general function it always returns double values. A double value is stored on 64 bits. Four characters are four bytes, meaning 32 bits. These four characters are coded in the lower 32 bits of the *double*. A simple way to throw away the upper 32 bits would be to just convert this value to *int*:
.. code-block:: cpp
VideoCapture inputVideo(source); // Open input
int ex = static_cast<int>(inputVideo.get(CV_CAP_PROP_FOURCC)); // Get Codec Type- Int form
OpenCV internally works with this integer type and expect this as its second parameter. Now to convert from the integer form to string we may use two methods: a bitwise operator and a union method. The first one extracting from an int the characters looks like (an "and" operation, some shifting and adding a 0 at the end to close the string):
.. code-block:: cpp
char EXT[] = {ex & 0XFF , (ex & 0XFF00) >> 8,(ex & 0XFF0000) >> 16,(ex & 0XFF000000) >> 24, 0};
You can do the same thing with the *union* as:
.. code-block:: cpp
union { int v; char c[5];} uEx ;
uEx.v = ex; // From Int to char via union
uEx.c[4]='\0';
The advantage of this is that the conversion is done automatically after assigning, while for the bitwise operator you need to do the operations whenever you change the codec type. In case you know the codecs four character code beforehand, you can use the *CV_FOURCC* macro to build the integer:
.. code-block::cpp
CV_FOURCC('P','I','M,'1') // this is an MPEG1 codec from the characters to integer
If you pass for this argument minus one than a window will pop up at runtime that contains all the codec installed on your system and ask you to select the one to use:
.. image:: images/videoCompressSelect.png
:alt: Select the codec type to use
:align: center
#. The frame per second for the output video. Again, here I keep the input videos frame per second by using the *get* function.
#. The size of the frames for the output video. Here too I keep the input videos frame size per second by using the *get* function.
#. The final argument is an optional one. By default is true and says that the output will be a colorful one (so for write you will send three channel images). To create a gray scale video pass a false parameter here.
Here it is, how I use it in the sample:
.. code-block:: cpp
VideoWriter outputVideo;
Size S = Size((int) inputVideo.get(CV_CAP_PROP_FRAME_WIDTH), //Acquire input size
(int) inputVideo.get(CV_CAP_PROP_FRAME_HEIGHT));
outputVideo.open(NAME , ex, inputVideo.get(CV_CAP_PROP_FPS),S, true);
Afterwards, you use the :huivideo:`isOpened() <videowriter-isopened>` function to find out if the open operation succeeded or not. The video file automatically closes when the *VideoWriter* object is destroyed. After you open the object with success you can send the frames of the video in a sequential order by using the :huivideo:`write<videowriter-write>` function of the class. Alternatively, you can use its overloaded operator << :
.. code-block:: cpp
outputVideo.write(res); //or
outputVideo << res;
Extracting a color channel from an RGB image means to set to zero the RGB values of the other channels. You can either do this with image scanning operations or by using the split and merge operations. You first split the channels up into different images, set the other channels to zero images of the same size and type and finally merge them back:
.. code-block:: cpp
split(src, spl); // process - extract only the correct channel
for( int i =0; i < 3; ++i)
if (i != channel)
spl[i] = Mat::zeros(S, spl[0].type());
merge(spl, res);
Put all this together and you'll get the upper source code, whose runtime result will show something around the idea:
.. image:: images/resultOutputWideoWrite.png
:alt: A sample output
:align: center
You may observe a runtime instance of this on the `YouTube here <https://www.youtube.com/watch?v=jpBwHxsl1_0>`_.
.. raw:: html
<div align="center">
<iframe title="Creating a video with OpenCV" width="560" height="349" src="http://www.youtube.com/embed/jpBwHxsl1_0?rel=0&loop=1" frameborder="0" allowfullscreen align="middle"></iframe>
</div>
\ No newline at end of file
.. _videoWriteHighGui:
Creating a video with OpenCV
****************************
Goal
====
Whenever you work with video feeds you may eventually want to save your image processing result in a form of a new video file. For simple video outputs you can use the OpenCV built-in :hgvideo:`VideoWriter <videowriter-videowriter>` class, designed for this.
.. container:: enumeratevisibleitemswithsquare
+ How to create a video file with OpenCV
+ What type of video files you can create with OpenCV
+ How to extract a given color channel from a video
As a simple demonstration I'll just extract one of the RGB color channels of an input video file into a new video. You can control the flow of the application from its console line arguments:
.. container:: enumeratevisibleitemswithsquare
+ The first argument points to the video file to work on
+ The second argument may be one of the characters: R G B. This will specify which of the channels to extract.
+ The last argument is the character Y (Yes) or N (No). If this is no, the codec used for the input video file will be the same as for the output. Otherwise, a window will pop up and allow you to select yourself the codec to use.
For example, a valid command line would look like:
.. code-block:: bash
video-write.exe video/Megamind.avi R Y
The source code
===============
You may also find the source code and these video file in the :file:`samples/cpp/tutorial_code/highgui/video-write/` folder of the OpenCV source library or :download:`download it from here <../../../../samples/cpp/tutorial_code/HighGUI/video-write/video-write.cpp>`.
For start, you should have an idea of just how a video file looks. Every video file in itself is a container. The type of the container is expressed in the files extension (for example *avi*, *mov* or *mkv*). This contains multiple elements like: video feeds, audio feeds or other tracks (like for example subtitles). How these feeds are stored is determined by the codec used for each one of them. In case of the audio tracks commonly used codecs are *mp3* or *aac*. For the video files the list is somehow longer and includes names such as *XVID*, *DIVX*, *H264* or *LAGS* (*Lagarith Lossless Codec*). The full list of codecs you may use on a system depends on just what one you have installed.
.. image:: images/videoFileStructure.png
:alt: The Structure of the video
:align: center
As you can see things can get really complicated with videos. However, OpenCV is mainly a computer vision library, not a video stream, codec and write one. Therefore, the developers tried to keep this part as simple as possible. Due to this OpenCV for video containers supports only the *avi* extension, its first version. A direct limitation of this is that you cannot save a video file larger than 2 GB. Furthermore you can only create and expand a single video track inside the container. No audio or other track editing support here. Nevertheless, any video codec present on your system might work. If you encounter some of these limitations you will need to look into more specialized video writing libraries such as *FFMpeg* or codecs as *HuffYUV*, *CorePNG* and *LCL*. As an alternative, create the video track with OpenCV and expand it with sound tracks or convert it to other formats by using video manipulation programs such as *VirtualDub* or *AviSynth*.
The *VideoWriter* class
=======================
The content written here builds on the assumption you already read the :ref:`videoInputPSNRMSSIM` tutorial and you know how to read video files.
To create a video file you just need to create an instance of the :hgvideo:`VideoWriter <videowriter-videowriter>` class. You can specify its properties either via parameters in the constructor or later on via the :hgvideo:`open <videowriter-open>` function. Either way, the parameters are the same:
1. The name of the output that contains the container type in its extension. At the moment only *avi* is supported. We construct this from the input file, add to this the name of the channel to use, and finish it off with the container extension.
.. code-block:: cpp
const string source = argv[1]; // the source file name
string::size_type pAt = source.find_last_of('.'); // Find extension point
const string NAME = source.substr(0, pAt) + argv[2][0] + ".avi"; // Form the new name with container
#. The codec to use for the video track. Now all the video codecs have a unique short name of maximum four characters. Hence, the *XVID*, *DIVX* or *H264* names. This is called a four character code. You may also ask this from an input video by using its *get* function. Because the *get* function is a general function it always returns double values. A double value is stored on 64 bits. Four characters are four bytes, meaning 32 bits. These four characters are coded in the lower 32 bits of the *double*. A simple way to throw away the upper 32 bits would be to just convert this value to *int*:
.. code-block:: cpp
VideoCapture inputVideo(source); // Open input
int ex = static_cast<int>(inputVideo.get(CV_CAP_PROP_FOURCC)); // Get Codec Type- Int form
OpenCV internally works with this integer type and expect this as its second parameter. Now to convert from the integer form to string we may use two methods: a bitwise operator and a union method. The first one extracting from an int the characters looks like (an "and" operation, some shifting and adding a 0 at the end to close the string):
The advantage of this is that the conversion is done automatically after assigning, while for the bitwise operator you need to do the operations whenever you change the codec type. In case you know the codecs four character code beforehand, you can use the *CV_FOURCC* macro to build the integer:
.. code-block::cpp
CV_FOURCC('P','I','M,'1') // this is an MPEG1 codec from the characters to integer
If you pass for this argument minus one than a window will pop up at runtime that contains all the codec installed on your system and ask you to select the one to use:
.. image:: images/videoCompressSelect.png
:alt: Select the codec type to use
:align: center
#. The frame per second for the output video. Again, here I keep the input videos frame per second by using the *get* function.
#. The size of the frames for the output video. Here too I keep the input videos frame size per second by using the *get* function.
#. The final argument is an optional one. By default is true and says that the output will be a colorful one (so for write you will send three channel images). To create a gray scale video pass a false parameter here.
Here it is, how I use it in the sample:
.. code-block:: cpp
VideoWriter outputVideo;
Size S = Size((int) inputVideo.get(CV_CAP_PROP_FRAME_WIDTH), //Acquire input size
Afterwards, you use the :hgvideo:`isOpened() <videowriter-isopened>` function to find out if the open operation succeeded or not. The video file automatically closes when the *VideoWriter* object is destroyed. After you open the object with success you can send the frames of the video in a sequential order by using the :hgvideo:`write<videowriter-write>` function of the class. Alternatively, you can use its overloaded operator << :
.. code-block:: cpp
outputVideo.write(res); //or
outputVideo << res;
Extracting a color channel from an RGB image means to set to zero the RGB values of the other channels. You can either do this with image scanning operations or by using the split and merge operations. You first split the channels up into different images, set the other channels to zero images of the same size and type and finally merge them back:
.. code-block:: cpp
split(src, spl); // process - extract only the correct channel
for( int i =0; i < 3; ++i)
if (i != channel)
spl[i] = Mat::zeros(S, spl[0].type());
merge(spl, res);
Put all this together and you'll get the upper source code, whose runtime result will show something around the idea:
.. image:: images/resultOutputWideoWrite.png
:alt: A sample output
:align: center
You may observe a runtime instance of this on the `YouTube here <https://www.youtube.com/watch?v=jpBwHxsl1_0>`_.
.. raw:: html
<div align="center">
<iframe title="Creating a video with OpenCV" width="560" height="349" src="http://www.youtube.com/embed/jpBwHxsl1_0?rel=0&loop=1" frameborder="0" allowfullscreen align="middle"></iframe>
Retrieve the current parameters values in a *Retina::RetinaParameters* structure
...
...
@@ -325,7 +325,7 @@ Retina::RetinaParameters
.. ocv:struct:: Retina::RetinaParameters
This structure merges all the parameters that can be adjusted threw the **Retina::setup()**, **Retina::setupOPLandIPLParvoChannel** and **Retina::setupIPLMagnoChannel** setup methods
Parameters structure for better clarity, check explenations on the comments of methods : setupOPLandIPLParvoChannel and setupIPLMagnoChannel. ::
Parameters structure for better clarity, check explenations on the comments of methods : setupOPLandIPLParvoChannel and setupIPLMagnoChannel. ::
@@ -210,9 +210,9 @@ The sample below demonstrates how to use RotatedRect:
.. seealso::
:ocv:cfunc:`CamShift`,
:ocv:func:`fitEllipse`,
:ocv:func:`minAreaRect`,
:ocv:func:`CamShift` ,
:ocv:func:`fitEllipse`,
:ocv:func:`minAreaRect`,
:ocv:struct:`CvBox2D`
TermCriteria
...
...
@@ -1303,7 +1303,7 @@ because ``cvtColor`` , as well as the most of OpenCV functions, calls ``Mat::cre
Mat::addref
---------------
-----------
Increments the reference counter.
.. ocv:function:: void Mat::addref()
...
...
@@ -1313,7 +1313,7 @@ The method increments the reference counter associated with the matrix data. If
Mat::release
----------------
------------
Decrements the reference counter and deallocates the matrix if needed.
.. ocv:function:: void Mat::release()
...
...
@@ -1324,7 +1324,7 @@ The method decrements the reference counter associated with the matrix data. Whe
This method can be called manually to force the matrix data deallocation. But since this method is automatically called in the destructor, or by any other method that changes the data pointer, it is usually not needed. The reference counter decrement and check for 0 is an atomic operation on the platforms that support it. Thus, it is safe to operate on the same matrices asynchronously in different threads.
Mat::resize
---------------
-----------
Changes the number of matrix rows.
.. ocv:function:: void Mat::resize( size_t sz )
...
...
@@ -1337,7 +1337,7 @@ The methods change the number of matrix rows. If the matrix is reallocated, the
Mat::reserve
---------------
------------
Reserves space for the certain number of rows.
.. ocv:function:: void Mat::reserve( size_t sz )
...
...
@@ -1370,7 +1370,7 @@ The method removes one or more rows from the bottom of the matrix.
////////////// some internally used methods ///////////////
...
// pointer to the sparse matrix header
Hdr* hdr;
};
The class ``SparseMat`` represents multi-dimensional sparse numerical arrays. Such a sparse array can store elements of any type that
:ocv:class:`Mat` can store. *Sparse* means that only non-zero elements are stored (though, as a result of operations on a sparse matrix, some of its stored elements can actually become 0. It is up to you to detect such elements and delete them using ``SparseMat::erase`` ). The non-zero elements are stored in a hash table that grows when it is filled so that the search time is O(1) in average (regardless of whether element is there or not). Elements can be accessed using the following methods:
...
...
@@ -2231,6 +2035,204 @@ The class ``SparseMat`` represents multi-dimensional sparse numerical arrays. Su
..
SparseMat::SparseMat
--------------------
Various SparseMat constructors.
.. ocv:function:: SparseMat::SparseMat()
.. ocv:function:: SparseMat::SparseMat(int dims, const int* _sizes, int _type)
.. ocv:function:: SparseMat::SparseMat(const SparseMat& m)
.. ocv:function:: SparseMat::SparseMat(const Mat& m, bool try1d=false)
.. ocv:function:: SparseMat::SparseMat(const CvSparseMat* m)
:param m: Source matrix for copy constructor. If m is dense matrix (ocv:class:`Mat`) then it will be converted to sparse representation.
:param dims: Array dimensionality.
:param _sizes: Sparce matrix size on all dementions.
:param _type: Sparse matrix data type.
:param try1d: if try1d is true and matrix is a single-column matrix (Nx1), then the sparse matrix will be 1-dimensional.
SparseMat::~SparseMat
---------------------
SparseMat object destructor.
.. ocv:function:: SparseMat::~SparseMat()
SparseMat::operator =
---------------------
Provides sparse matrix assignment operators.
.. ocv:function:: SparseMat& SparseMat::operator=(const SparseMat& m)
.. ocv:function:: SparseMat& SparseMat::operator=(const Mat& m)
The last variant is equivalent to the corresponding constructor with try1d=false.
The method returns a sparse matrix element type. This is an identifier compatible with the ``CvMat`` type system, like ``CV_16SC3`` or 16-bit signed 3-channel array, and so on.
SparseMat::depth
----------------
Returns the depth of a sparse matrix element.
.. ocv:function:: int SparseMat::depth() const
The method returns the identifier of the matrix element depth (the type of each individual channel). For example, for a 16-bit signed 3-channel array, the method returns ``CV_16S``
@@ -166,6 +166,12 @@ field of the set is the total number of nodes both occupied and free. When an oc
``CvSet`` is used to represent graphs (:ocv:struct:`CvGraph`), sparse multi-dimensional arrays (:ocv:struct:`CvSparseMat`), and planar subdivisions (:ocv:struct:`CvSubdiv2D`).
CvSetElem
---------
.. ocv:struct:: CvSetElem
The structure is represent single element of :ocv:struct:`CvSet`. It consists of two fields: element data pointer and flags.
CvGraph
-------
...
...
@@ -174,6 +180,24 @@ CvGraph
The structure ``CvGraph`` is a base for graphs used in OpenCV 1.x. It inherits from
:ocv:struct:`CvSet`, that is, it is considered as a set of vertices. Besides, it contains another set as a member, a set of graph edges. Graphs in OpenCV are represented using adjacency lists format.
CvGraphVtx
----------
.. ocv:struct:: CvGraphVtx
The structure represents single vertex in :ocv:struct:`CvGraph`. It consists of two filds: pointer to first edge and flags.
CvGraphEdge
-----------
.. ocv:struct:: CvGraphEdge
The structure represents edge in :ocv:struct:`CvGraph`. Each edge consists of:
- Two pointers to the starting and ending vertices (vtx[0] and vtx[1] respectively);
- Two pointers to next edges for the starting and ending vertices, where
next[0] points to the next edge in the vtx[0] adjacency list and
next[1] points to the next edge in the vtx[1] adjacency list;
* **SVD::NO_UV** indicates that only a vector of singular values ``w`` is to be processed, while ``u`` and ``vt`` will be set to empty matrices.
* **SVD::FULL_UV** when the matrix is not square, by default the algorithm produces ``u`` and ``vt`` matrices of sufficiently large size for the further ``A`` reconstruction; if, however, ``FULL_UV`` flag is specified, ``u`` and ``vt``will be full-size square orthogonal matrices.
* **SVD::FULL_UV** when the matrix is not square, by default the algorithm produces ``u`` and ``vt`` matrices of sufficiently large size for the further ``A`` reconstruction; if, however, ``FULL_UV`` flag is specified, ``u`` and ``vt`` will be full-size square orthogonal matrices.
The first constructor initializes an empty ``SVD`` structure. The second constructor initializes an empty ``SVD`` structure and then calls
.. ocv:function:: DynamicAdaptedFeatureDetector::DynamicAdaptedFeatureDetector( const Ptr<AdjusterAdapter>& adjuster, int min_features=400, int max_features=500, int max_iters=5 )
...
...
@@ -484,7 +483,7 @@ Example: ::
AdjusterAdapter::good
-------------------------
---------------------
Returns false if the detector parameters cannot be adjusted any more.
@@ -6,6 +6,7 @@ Fast Approximate Nearest Neighbor Search
This section documents OpenCV's interface to the FLANN library. FLANN (Fast Library for Approximate Nearest Neighbors) is a library that contains a collection of algorithms optimized for fast nearest neighbor search in large datasets and for high dimensional features. More information about FLANN can be found in [Muja2009]_ .
.. [Muja2009] Marius Muja, David G. Lowe. Fast Approximate Nearest Neighbors with Automatic Algorithm Configuration, 2009
flann::Index\_
-----------------
...
...
@@ -150,7 +151,7 @@ flann::Index_<T>::knnSearch
----------------------------
Performs a K-nearest neighbor search for a given query point using the index.
:param fps: Framerate of the created video stream.
:param params: Encoder parameters. See :ocv:class:`gpu::VideoWriter_GPU::EncoderParams` .
:param params: Encoder parameters. See :ocv:struct:`gpu::VideoWriter_GPU::EncoderParams` .
:param format: Surface format of input frames ( ``SF_UYVY`` , ``SF_YUY2`` , ``SF_YV12`` , ``SF_NV12`` , ``SF_IYUV`` , ``SF_BGR`` or ``SF_GRAY``). BGR or gray frames will be converted to YV12 format before encoding, frames with other formats will be used as is.
The weak tree classifier, a component of the boosted tree classifier :ocv:class:`CvBoost`, is a derivative of :ocv:class:`CvDTree`. Normally, there is no need to use the weak classifiers directly. However, they can be accessed as elements of the sequence :ocv:member:`CvBoost::weak`, retrieved by :ocv:func:`CvBoost::get_weak_predictors`.
The weak tree classifier, a component of the boosted tree classifier :ocv:class:`CvBoost`, is a derivative of :ocv:class:`CvDTree`. Normally, there is no need to use the weak classifiers directly. However, they can be accessed as elements of the sequence ``CvBoost::weak``, retrieved by :ocv:func:`CvBoost::get_weak_predictors`.
.. note:: In case of LogitBoost and Gentle AdaBoost, each weak predictor is a regression tree, rather than a classification tree. Even in case of Discrete AdaBoost and Real AdaBoost, the ``CvBoostTree::predict`` return value (:ocv:member:`CvDTreeNode::value`) is not an output class label. A negative value "votes" for class #0, a positive value - for class #1. The votes are weighted. The weight of each individual tree may be increased or decreased using the method ``CvBoostTree::scale``.
...
...
@@ -233,4 +233,3 @@ CvBoost::get_data
Returns used train data of the boosted tree classifier.
@@ -148,7 +148,7 @@ Brute-force descriptor matcher. For each descriptor in the first set, this match
The class ``BruteForceMatcher_OCL_base`` has an interface similar to the class :ocv:class:`DescriptorMatcher`. It has two groups of ``match`` methods: for matching descriptors of one image with another image or with an image set. Also, all functions have an alternative to save results either to the GPU memory or to the CPU memory. ``BruteForceMatcher_OCL_base`` supports only the ``L1<float>``, ``L2<float>``, and ``Hamming`` distance types.
@@ -56,7 +56,7 @@ Class providing memory buffers for :ocv:func:`ocl::matchTemplate` function, plus
You can use field `user_block_size` to set specific block size for :ocv:func:`ocl::matchTemplate` function. If you leave its default value `Size(0,0)` then automatic estimation of block size will be used (which is optimized for speed). By varying `user_block_size` you can reduce memory requirements at the cost of speed.
ocl::matchTemplate
----------------------
------------------
Computes a proximity map for a raster template and an image where the template is searched for.