introduced new RST/Sphinx domain ocv.
This commit is contained in:
@@ -5,10 +5,10 @@ Basic Structures
|
||||
|
||||
DataType
|
||||
--------
|
||||
.. cpp:class:: DataType
|
||||
.. ocv:class:: DataType
|
||||
|
||||
Template "trait" class for OpenCV primitive data types. A primitive OpenCV data type is one of ``unsigned char``, ``bool``, ``signed char``, ``unsigned short``, ``signed short``, ``int``, ``float``, ``double``, or a tuple of values of one of these types, where all the values in the tuple have the same type. Any primitive type from the list can be defined by an identifier in the form ``CV_<bit-depth>{U|S|F}C(<number_of_channels>)``, for example: ``uchar`` ~ ``CV_8UC1``, 3-element floating-point tuple ~ ``CV_32FC3``, and so on. A universal OpenCV structure that is able to store a single instance of such a primitive data type is
|
||||
:cpp:class:`Vec`. Multiple instances of such a type can be stored in a ``std::vector``, ``Mat``, ``Mat_``, ``SparseMat``, ``SparseMat_``, or any other container that is able to store ``Vec`` instances.
|
||||
:ocv:class:`Vec`. Multiple instances of such a type can be stored in a ``std::vector``, ``Mat``, ``Mat_``, ``SparseMat``, ``SparseMat_``, or any other container that is able to store ``Vec`` instances.
|
||||
|
||||
The ``DataType`` class is basically used to provide a description of such primitive data types without adding any fields or methods to the corresponding classes (and it is actually impossible to add anything to primitive C/C++ data types). This technique is known in C++ as class traits. It is not ``DataType`` itself that is used but its specialized versions, such as: ::
|
||||
|
||||
@@ -47,7 +47,7 @@ So, such traits are used to tell OpenCV which data type you are working with, ev
|
||||
|
||||
Point\_
|
||||
-------
|
||||
.. cpp:class:: Point_
|
||||
.. ocv:class:: Point_
|
||||
|
||||
Template class for 2D points specified by its coordinates
|
||||
:math:`x` and
|
||||
@@ -82,7 +82,7 @@ Example: ::
|
||||
|
||||
Point3\_
|
||||
--------
|
||||
.. cpp:class:: Point3_
|
||||
.. ocv:class:: Point3_
|
||||
|
||||
Template class for 3D points specified by its coordinates
|
||||
:math:`x`,
|
||||
@@ -98,7 +98,7 @@ The following ``Point3_<>`` aliases are available: ::
|
||||
|
||||
Size\_
|
||||
------
|
||||
.. cpp:class:: Size_
|
||||
.. ocv:class:: Size_
|
||||
|
||||
Template class for specfying the size of an image or rectangle. The class includes two members called ``width`` and ``height``. The structure can be converted to and from the old OpenCV structures
|
||||
``CvSize`` and ``CvSize2D32f`` . The same set of arithmetic and comparison operations as for ``Point_`` is available.
|
||||
@@ -111,7 +111,7 @@ OpenCV defines the following ``Size_<>`` aliases: ::
|
||||
|
||||
Rect\_
|
||||
------
|
||||
.. cpp:class:: Rect_
|
||||
.. ocv:class:: Rect_
|
||||
|
||||
Template class for 2D rectangles, described by the following parameters::
|
||||
|
||||
@@ -169,20 +169,20 @@ For your convenience, the ``Rect_<>`` alias is available: ::
|
||||
|
||||
RotatedRect
|
||||
-----------
|
||||
.. cpp:class:: RotatedRect
|
||||
.. ocv:class:: RotatedRect
|
||||
|
||||
Template class for rotated rectangles specified by the center, size, and the rotation angle in degrees.
|
||||
|
||||
|
||||
TermCriteria
|
||||
------------
|
||||
.. cpp:class:: TermCriteria
|
||||
.. ocv:class:: TermCriteria
|
||||
|
||||
Template class defining termination criteria for iterative algorithms.
|
||||
|
||||
Matx
|
||||
----
|
||||
.. cpp:class:: Matx
|
||||
.. ocv:class:: Matx
|
||||
|
||||
Template class for small matrices whose type and size are known at compilation time: ::
|
||||
|
||||
@@ -206,7 +206,7 @@ Template class for small matrices whose type and size are known at compilation t
|
||||
typedef Matx<float, 6, 6> Matx66f;
|
||||
typedef Matx<double, 6, 6> Matx66d;
|
||||
|
||||
If you need a more flexible type, use :cpp:class:`Mat` . The elements of the matrix ``M`` are accessible using the ``M(i,j)`` notation. Most of the common matrix operations (see also
|
||||
If you need a more flexible type, use :ocv:class:`Mat` . The elements of the matrix ``M`` are accessible using the ``M(i,j)`` notation. Most of the common matrix operations (see also
|
||||
:ref:`MatrixExpressions` ) are available. To do an operation on ``Matx`` that is not implemented, you can easily convert the matrix to
|
||||
``Mat`` and backwards. ::
|
||||
|
||||
@@ -218,9 +218,9 @@ If you need a more flexible type, use :cpp:class:`Mat` . The elements of the mat
|
||||
|
||||
Vec
|
||||
---
|
||||
.. cpp:class:: Vec
|
||||
.. ocv:class:: Vec
|
||||
|
||||
Template class for short numerical vectors, a partial case of :cpp:class:`Matx`: ::
|
||||
Template class for short numerical vectors, a partial case of :ocv:class:`Matx`: ::
|
||||
|
||||
template<typename _Tp, int n> class Vec : public Matx<_Tp, n, 1> {...};
|
||||
|
||||
@@ -246,7 +246,7 @@ Template class for short numerical vectors, a partial case of :cpp:class:`Matx`:
|
||||
typedef Vec<double, 4> Vec4d;
|
||||
typedef Vec<double, 6> Vec6d;
|
||||
|
||||
It is possible to convert ``Vec<T,2>`` to/from ``Point_``, ``Vec<T,3>`` to/from ``Point3_`` , and ``Vec<T,4>`` to ``CvScalar`` or :cpp:class:`Scalar`. Use ``operator[]`` to access the elements of ``Vec``.
|
||||
It is possible to convert ``Vec<T,2>`` to/from ``Point_``, ``Vec<T,3>`` to/from ``Point3_`` , and ``Vec<T,4>`` to ``CvScalar`` or :ocv:class:`Scalar`. Use ``operator[]`` to access the elements of ``Vec``.
|
||||
|
||||
All the expected vector operations are also implemented:
|
||||
|
||||
@@ -259,11 +259,11 @@ All the expected vector operations are also implemented:
|
||||
* ``v1 == v2, v1 != v2``
|
||||
* ``norm(v1)`` (euclidean norm)
|
||||
|
||||
The ``Vec`` class is commonly used to describe pixel types of multi-channel arrays. See :cpp:class:`Mat` for details.
|
||||
The ``Vec`` class is commonly used to describe pixel types of multi-channel arrays. See :ocv:class:`Mat` for details.
|
||||
|
||||
Scalar\_
|
||||
--------
|
||||
.. cpp:class:: Scalar_
|
||||
.. ocv:class:: Scalar_
|
||||
|
||||
Template class for a 4-element vector derived from Vec. ::
|
||||
|
||||
@@ -275,7 +275,7 @@ Being derived from ``Vec<_Tp, 4>`` , ``Scalar_`` and ``Scalar`` can be used just
|
||||
|
||||
Range
|
||||
-----
|
||||
.. cpp:class:: Range
|
||||
.. ocv:class:: Range
|
||||
|
||||
Template class specifying a continuous subsequence (slice) of a sequence. ::
|
||||
|
||||
@@ -287,7 +287,7 @@ Template class specifying a continuous subsequence (slice) of a sequence. ::
|
||||
};
|
||||
|
||||
The class is used to specify a row or a column span in a matrix (
|
||||
:cpp:class:`Mat` ) and for many other purposes. ``Range(a,b)`` is basically the same as ``a:b`` in Matlab or ``a..b`` in Python. As in Python, ``start`` is an inclusive left boundary of the range and ``end`` is an exclusive right boundary of the range. Such a half-opened interval is usually denoted as
|
||||
:ocv:class:`Mat` ) and for many other purposes. ``Range(a,b)`` is basically the same as ``a:b`` in Matlab or ``a..b`` in Python. As in Python, ``start`` is an inclusive left boundary of the range and ``end`` is an exclusive right boundary of the range. Such a half-opened interval is usually denoted as
|
||||
:math:`[start,end)` .
|
||||
|
||||
The static method ``Range::all()`` returns a special variable that means "the whole sequence" or "the whole range", just like " ``:`` " in Matlab or " ``...`` " in Python. All the methods and functions in OpenCV that take ``Range`` support this special ``Range::all()`` value. But, of course, in case of your own custom processing, you will probably have to check and handle it explicitly: ::
|
||||
@@ -305,7 +305,7 @@ The static method ``Range::all()`` returns a special variable that means "the wh
|
||||
|
||||
Ptr
|
||||
---
|
||||
.. cpp:class:: Ptr
|
||||
.. ocv:class:: Ptr
|
||||
|
||||
Template class for smart reference-counting pointers ::
|
||||
|
||||
@@ -389,11 +389,11 @@ However, if the object is deallocated in a different way, the specialized method
|
||||
// the file will be closed automatically by the Ptr<FILE> destructor.
|
||||
|
||||
|
||||
.. note:: The reference increment/decrement operations are implemented as atomic operations, and therefore it is normally safe to use the classes in multi-threaded applications. The same is true for :cpp:class:`Mat` and other C++ OpenCV classes that operate on the reference counters.
|
||||
.. note:: The reference increment/decrement operations are implemented as atomic operations, and therefore it is normally safe to use the classes in multi-threaded applications. The same is true for :ocv:class:`Mat` and other C++ OpenCV classes that operate on the reference counters.
|
||||
|
||||
Mat
|
||||
---
|
||||
.. cpp:class:: Mat
|
||||
.. ocv:class:: Mat
|
||||
|
||||
OpenCV C++ n-dimensional dense array class ::
|
||||
|
||||
@@ -588,7 +588,7 @@ There are many different ways to create a ``Mat`` object. The most popular optio
|
||||
|
||||
..
|
||||
|
||||
With this approach, you first call a constructor of the :cpp:class:`Mat_` class with the proper parameters, and then you just put ``<<`` operator followed by comma-separated values that can be constants, variables, expressions, and so on. Also, note the extra parentheses required to avoid compilation errors.
|
||||
With this approach, you first call a constructor of the :ocv:class:`Mat_` class with the proper parameters, and then you just put ``<<`` operator followed by comma-separated values that can be constants, variables, expressions, and so on. Also, note the extra parentheses required to avoid compilation errors.
|
||||
|
||||
Once the array is created, it is automatically managed via a reference-counting mechanism. If the array header is built on top of user-allocated data, you should handle the data by yourself.
|
||||
The array data is deallocated when no one points to it. If you want to release the data pointed by a array header before the array destructor is called, use ``Mat::release()`` .
|
||||
@@ -688,7 +688,7 @@ for a scalar ( ``Scalar`` ),
|
||||
any function of matrix or matrices and scalars that returns a matrix or a scalar, such as ``norm``, ``mean``, ``sum``, ``countNonZero``, ``trace``, ``determinant``, ``repeat``, and others.
|
||||
|
||||
*
|
||||
Matrix initializers ( ``eye(), zeros(), ones()`` ), matrix comma-separated initializers, matrix constructors and operators that extract sub-matrices (see :cpp:class:`Mat` description).
|
||||
Matrix initializers ( ``eye(), zeros(), ones()`` ), matrix comma-separated initializers, matrix constructors and operators that extract sub-matrices (see :ocv:class:`Mat` description).
|
||||
|
||||
*
|
||||
``Mat_<destination_type>()`` constructors to cast the result to the proper type.
|
||||
@@ -699,45 +699,45 @@ Below is the formal description of the ``Mat`` methods.
|
||||
|
||||
Mat::Mat
|
||||
------------
|
||||
.. cpp:function:: Mat::Mat()
|
||||
.. ocv:function:: Mat::Mat()
|
||||
|
||||
.. cpp:function:: Mat::Mat(int rows, int cols, int type)
|
||||
.. ocv:function:: Mat::Mat(int rows, int cols, int type)
|
||||
|
||||
.. cpp:function:: Mat::Mat(Size size, int type)
|
||||
.. ocv:function:: Mat::Mat(Size size, int type)
|
||||
|
||||
.. cpp:function:: Mat::Mat(int rows, int cols, int type, const Scalar& s)
|
||||
.. ocv:function:: Mat::Mat(int rows, int cols, int type, const Scalar& s)
|
||||
|
||||
.. cpp:function:: Mat::Mat(Size size, int type, const Scalar& s)
|
||||
.. ocv:function:: Mat::Mat(Size size, int type, const Scalar& s)
|
||||
|
||||
.. cpp:function:: Mat::Mat(const Mat& m)
|
||||
.. ocv:function:: Mat::Mat(const Mat& m)
|
||||
|
||||
.. cpp:function:: Mat::Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP)
|
||||
.. ocv:function:: Mat::Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP)
|
||||
|
||||
.. cpp:function:: Mat::Mat(Size size, int type, void* data, size_t step=AUTO_STEP)
|
||||
.. ocv:function:: Mat::Mat(Size size, int type, void* data, size_t step=AUTO_STEP)
|
||||
|
||||
.. cpp:function:: Mat::Mat(const Mat& m, const Range& rowRange, const Range& colRange)
|
||||
.. ocv:function:: Mat::Mat(const Mat& m, const Range& rowRange, const Range& colRange)
|
||||
|
||||
.. cpp:function:: Mat::Mat(const Mat& m, const Rect& roi)
|
||||
.. ocv:function:: Mat::Mat(const Mat& m, const Rect& roi)
|
||||
|
||||
.. cpp:function:: Mat::Mat(const CvMat* m, bool copyData=false)
|
||||
.. ocv:function:: Mat::Mat(const CvMat* m, bool copyData=false)
|
||||
|
||||
.. cpp:function:: Mat::Mat(const IplImage* img, bool copyData=false)
|
||||
.. ocv:function:: Mat::Mat(const IplImage* img, bool copyData=false)
|
||||
|
||||
.. cpp:function:: template<typename T, int n> explicit Mat::Mat(const Vec<T, n>& vec, bool copyData=true)
|
||||
.. ocv:function:: template<typename T, int n> explicit Mat::Mat(const Vec<T, n>& vec, bool copyData=true)
|
||||
|
||||
.. cpp:function:: template<typename T, int m, int n> explicit Mat::Mat(const Matx<T, m, n>& vec, bool copyData=true)
|
||||
.. ocv:function:: template<typename T, int m, int n> explicit Mat::Mat(const Matx<T, m, n>& vec, bool copyData=true)
|
||||
|
||||
.. cpp:function:: template<typename T> explicit Mat::Mat(const vector<T>& vec, bool copyData=false)
|
||||
.. ocv:function:: template<typename T> explicit Mat::Mat(const vector<T>& vec, bool copyData=false)
|
||||
|
||||
.. cpp:function:: Mat::Mat(const MatExpr& expr)
|
||||
.. ocv:function:: Mat::Mat(const MatExpr& expr)
|
||||
|
||||
.. cpp:function:: Mat::Mat(int ndims, const int* sizes, int type)
|
||||
.. ocv:function:: Mat::Mat(int ndims, const int* sizes, int type)
|
||||
|
||||
.. cpp:function:: Mat::Mat(int ndims, const int* sizes, int type, const Scalar& s)
|
||||
.. ocv:function:: Mat::Mat(int ndims, const int* sizes, int type, const Scalar& s)
|
||||
|
||||
.. cpp:function:: Mat::Mat(int ndims, const int* sizes, int type, void* data, const size_t* steps=0)
|
||||
.. ocv:function:: Mat::Mat(int ndims, const int* sizes, int type, void* data, const size_t* steps=0)
|
||||
|
||||
.. cpp:function:: Mat::Mat(const Mat& m, const Range* ranges)
|
||||
.. ocv:function:: Mat::Mat(const Mat& m, const Range* ranges)
|
||||
|
||||
Provides various array constructors.
|
||||
|
||||
@@ -757,7 +757,7 @@ Mat::Mat
|
||||
|
||||
:param data: Pointer to the user data. Matrix constructors that take ``data`` and ``step`` parameters do not allocate matrix data. Instead, they just initialize the matrix header that points to the specified data, which means that no data is copied. This operation is very efficient and can be used to process external data using OpenCV functions. The external data is not automatically deallocated, so you should take care of it.
|
||||
|
||||
:param step: Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. If the parameter is missing (set to ``AUTO_STEP`` ), no padding is assumed and the actual step is calculated as ``cols*elemSize()`` . See :cpp:func:`Mat::elemSize` .
|
||||
:param step: Number of bytes each matrix row occupies. The value should include the padding bytes at the end of each row, if any. If the parameter is missing (set to ``AUTO_STEP`` ), no padding is assumed and the actual step is calculated as ``cols*elemSize()`` . See :ocv:func:`Mat::elemSize` .
|
||||
|
||||
:param steps: Array of ``ndims-1`` steps in case of a multi-dimensional array (the last step is always set to the element size). If not specified, the matrix is assumed to be continuous.
|
||||
|
||||
@@ -765,7 +765,7 @@ Mat::Mat
|
||||
|
||||
:param img: Pointer to the old-style ``IplImage`` image structure. By default, the data is shared between the original image and the new matrix. But when ``copyData`` is set, the full copy of the image data is created.
|
||||
|
||||
:param vec: STL vector whose elements form the matrix. The matrix has a single column and the number of rows equal to the number of vector elements. Type of the matrix matches the type of vector elements. The constructor can handle arbitrary types, for which there is a properly declared :cpp:class:`DataType` . This means that the vector elements must be primitive numbers or uni-type numerical tuples of numbers. Mixed-type structures are not supported. The corresponding constructor is explicit. Since STL vectors are not automatically converted to ``Mat`` instances, you should write ``Mat(vec)`` explicitly. Unless you copy the data into the matrix ( ``copyData=true`` ), no new elements will be added to the vector because it can potentially yield vector data reallocation, and, thus, the matrix data pointer will be invalid.
|
||||
:param vec: STL vector whose elements form the matrix. The matrix has a single column and the number of rows equal to the number of vector elements. Type of the matrix matches the type of vector elements. The constructor can handle arbitrary types, for which there is a properly declared :ocv:class:`DataType` . This means that the vector elements must be primitive numbers or uni-type numerical tuples of numbers. Mixed-type structures are not supported. The corresponding constructor is explicit. Since STL vectors are not automatically converted to ``Mat`` instances, you should write ``Mat(vec)`` explicitly. Unless you copy the data into the matrix ( ``copyData=true`` ), no new elements will be added to the vector because it can potentially yield vector data reallocation, and, thus, the matrix data pointer will be invalid.
|
||||
|
||||
:param copyData: Flag to specify whether the underlying data of the STL vector or the old-style ``CvMat`` or ``IplImage`` should be copied to (``true``) or shared with (``false``) the newly constructed matrix. When the data is copied, the allocated buffer is managed using ``Mat`` reference counting mechanism. While the data is shared, the reference counter is NULL, and you should not deallocate the data until the matrix is not destructed.
|
||||
|
||||
@@ -779,30 +779,30 @@ Mat::Mat
|
||||
|
||||
These are various constructors that form a matrix. As noted in the :ref:`AutomaticAllocation`,
|
||||
often the default constructor is enough, and the proper matrix will be allocated by an OpenCV function. The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with
|
||||
:cpp:func:`Mat::create` . In the former case, the old content is de-referenced.
|
||||
:ocv:func:`Mat::create` . In the former case, the old content is de-referenced.
|
||||
|
||||
|
||||
Mat::~Mat
|
||||
------------
|
||||
.. cpp:function:: Mat::~Mat()
|
||||
.. ocv:function:: Mat::~Mat()
|
||||
|
||||
Provides a matrix destructor.
|
||||
|
||||
The matrix destructor calls
|
||||
:cpp:func:`Mat::release` .
|
||||
:ocv:func:`Mat::release` .
|
||||
|
||||
|
||||
Mat::operator =
|
||||
-------------------
|
||||
.. cpp:function:: Mat& Mat::operator = (const Mat& m)
|
||||
.. ocv:function:: Mat& Mat::operator = (const Mat& m)
|
||||
|
||||
.. cpp:function:: Mat& Mat::operator = (const MatExpr_Base& expr)
|
||||
.. ocv:function:: Mat& Mat::operator = (const MatExpr_Base& expr)
|
||||
|
||||
.. cpp:function:: Mat& operator = (const Scalar& s)
|
||||
.. ocv:function:: Mat& operator = (const Scalar& s)
|
||||
|
||||
Provides matrix assignment operators.
|
||||
|
||||
:param m: Assigned, right-hand-side matrix. Matrix assignment is an O(1) operation. This means that no data is copied but the data is shared and the reference counter, if any, is incremented. Before assigning new data, the old data is de-referenced via :cpp:func:`Mat::release` .
|
||||
:param m: Assigned, right-hand-side matrix. Matrix assignment is an O(1) operation. This means that no data is copied but the data is shared and the reference counter, if any, is incremented. Before assigning new data, the old data is de-referenced via :ocv:func:`Mat::release` .
|
||||
|
||||
:param expr: Assigned matrix expression object. As opposite to the first form of the assignment operation, the second form can reuse already allocated matrix if it has the right size and type to fit the matrix expression result. It is automatically handled by the real function that the matrix expressions is expanded to. For example, ``C=A+B`` is expanded to ``add(A, B, C)`` , and :func:`add` takes care of automatic ``C`` reallocation.
|
||||
|
||||
@@ -813,7 +813,7 @@ These are available assignment operators. Since they all are very different, mak
|
||||
|
||||
Mat::operator MatExpr
|
||||
-------------------------
|
||||
.. cpp:function:: Mat::operator MatExpr_<Mat, Mat>() const
|
||||
.. ocv:function:: Mat::operator MatExpr_<Mat, Mat>() const
|
||||
|
||||
Provides a ``Mat`` -to- ``MatExpr`` cast operator.
|
||||
|
||||
@@ -822,7 +822,7 @@ The cast operator should not be called explicitly. It is used internally by the
|
||||
|
||||
Mat::row
|
||||
------------
|
||||
.. cpp:function:: Mat Mat::row(int i) const
|
||||
.. ocv:function:: Mat Mat::row(int i) const
|
||||
|
||||
Creates a matrix header for the specified matrix row.
|
||||
|
||||
@@ -846,7 +846,7 @@ The method makes a new header for the specified matrix row and returns it. This
|
||||
|
||||
|
||||
This happens because ``A.row(i)`` forms a temporary header that is further assigned to another header. Remember that each of these operations is O(1), that is, no data is copied. Thus, the above assignment is not true if you may have expected the j-th row to be copied to the i-th row. To achieve that, you should either turn this simple assignment into an expression or use the
|
||||
:cpp:func:`Mat::copyTo` method: ::
|
||||
:ocv:func:`Mat::copyTo` method: ::
|
||||
|
||||
Mat A;
|
||||
...
|
||||
@@ -858,21 +858,21 @@ The method makes a new header for the specified matrix row and returns it. This
|
||||
|
||||
Mat::col
|
||||
------------
|
||||
.. cpp:function:: Mat Mat::col(int j) const
|
||||
.. ocv:function:: Mat Mat::col(int j) const
|
||||
|
||||
Creates a matrix header for the specified matrix column.
|
||||
|
||||
:param j: A 0-based column index.
|
||||
|
||||
The method makes a new header for the specified matrix column and returns it. This is an O(1) operation, regardless of the matrix size. The underlying data of the new matrix is shared with the original matrix. See also the
|
||||
:cpp:func:`Mat::row` description.
|
||||
:ocv:func:`Mat::row` description.
|
||||
|
||||
|
||||
Mat::rowRange
|
||||
-----------------
|
||||
.. cpp:function:: Mat Mat::rowRange(int startrow, int endrow) const
|
||||
.. ocv:function:: Mat Mat::rowRange(int startrow, int endrow) const
|
||||
|
||||
.. cpp:function:: Mat Mat::rowRange(const Range& r) const
|
||||
.. ocv:function:: Mat Mat::rowRange(const Range& r) const
|
||||
|
||||
Creates a matrix header for the specified row span.
|
||||
|
||||
@@ -880,17 +880,17 @@ Mat::rowRange
|
||||
|
||||
:param endrow: A 0-based ending index of the row span.
|
||||
|
||||
:param r: :cpp:class:`Range` structure containing both the start and the end indices.
|
||||
:param r: :ocv:class:`Range` structure containing both the start and the end indices.
|
||||
|
||||
The method makes a new header for the specified row span of the matrix. Similarly to
|
||||
:cpp:func:`Mat::row` and
|
||||
:cpp:func:`Mat::col` , this is an O(1) operation.
|
||||
:ocv:func:`Mat::row` and
|
||||
:ocv:func:`Mat::col` , this is an O(1) operation.
|
||||
|
||||
Mat::colRange
|
||||
-----------------
|
||||
.. cpp:function:: Mat Mat::colRange(int startcol, int endcol) const
|
||||
.. ocv:function:: Mat Mat::colRange(int startcol, int endcol) const
|
||||
|
||||
.. cpp:function:: Mat Mat::colRange(const Range& r) const
|
||||
.. ocv:function:: Mat Mat::colRange(const Range& r) const
|
||||
|
||||
Creates a matrix header for the specified row span.
|
||||
|
||||
@@ -898,17 +898,17 @@ Mat::colRange
|
||||
|
||||
:param endcol: A 0-based ending index of the column span.
|
||||
|
||||
:param r: :cpp:class:`Range` structure containing both the start and the end indices.
|
||||
:param r: :ocv:class:`Range` structure containing both the start and the end indices.
|
||||
|
||||
The method makes a new header for the specified column span of the matrix. Similarly to
|
||||
:cpp:func:`Mat::row` and
|
||||
:cpp:func:`Mat::col` , this is an O(1) operation.
|
||||
:ocv:func:`Mat::row` and
|
||||
:ocv:func:`Mat::col` , this is an O(1) operation.
|
||||
|
||||
Mat::diag
|
||||
-------------
|
||||
.. cpp:function:: Mat Mat::diag(int d) const
|
||||
.. ocv:function:: Mat Mat::diag(int d) const
|
||||
|
||||
.. cpp:function:: static Mat Mat::diag(const Mat& matD)
|
||||
.. ocv:function:: static Mat Mat::diag(const Mat& matD)
|
||||
|
||||
Extracts a diagonal from a matrix, or creates a diagonal matrix.
|
||||
|
||||
@@ -923,12 +923,12 @@ Mat::diag
|
||||
:param matD: Single-column matrix that forms a diagonal matrix.
|
||||
|
||||
The method makes a new header for the specified matrix diagonal. The new matrix is represented as a single-column matrix. Similarly to
|
||||
:cpp:func:`Mat::row` and
|
||||
:cpp:func:`Mat::col` , this is an O(1) operation.
|
||||
:ocv:func:`Mat::row` and
|
||||
:ocv:func:`Mat::col` , this is an O(1) operation.
|
||||
|
||||
Mat::clone
|
||||
--------------
|
||||
.. cpp:function:: Mat Mat::clone() const
|
||||
.. ocv:function:: Mat Mat::clone() const
|
||||
|
||||
Creates a full copy of the array and the underlying data.
|
||||
|
||||
@@ -937,8 +937,8 @@ The method creates a full copy of the array. The original ``step[]`` is not take
|
||||
|
||||
Mat::copyTo
|
||||
---------------
|
||||
.. cpp:function:: void Mat::copyTo( OutputArray m ) const
|
||||
.. cpp:function:: void Mat::copyTo( OutputArray m, InputArray mask ) const
|
||||
.. ocv:function:: void Mat::copyTo( OutputArray m ) const
|
||||
.. ocv:function:: void Mat::copyTo( OutputArray m, InputArray mask ) const
|
||||
|
||||
Copies the matrix to another one.
|
||||
|
||||
@@ -957,7 +957,7 @@ When the operation mask is specified, and the ``Mat::create`` call shown above r
|
||||
|
||||
Mat::convertTo
|
||||
------------------
|
||||
.. cpp:function:: void Mat::convertTo( OutputArray m, int rtype, double alpha=1, double beta=0 ) const
|
||||
.. ocv:function:: void Mat::convertTo( OutputArray m, int rtype, double alpha=1, double beta=0 ) const
|
||||
|
||||
Converts an array to another datatype with optional scaling.
|
||||
|
||||
@@ -978,7 +978,7 @@ The method converts source pixel values to the target datatype. ``saturate_cast<
|
||||
|
||||
Mat::assignTo
|
||||
-----------------
|
||||
.. cpp:function:: void Mat::assignTo( Mat& m, int type=-1 ) const
|
||||
.. ocv:function:: void Mat::assignTo( Mat& m, int type=-1 ) const
|
||||
|
||||
Provides a functional form of ``convertTo``.
|
||||
|
||||
@@ -991,7 +991,7 @@ This is an internally used method called by the
|
||||
|
||||
Mat::setTo
|
||||
--------------
|
||||
.. cpp:function:: Mat& Mat::setTo(const Scalar& s, InputArray mask=noArray())
|
||||
.. ocv:function:: Mat& Mat::setTo(const Scalar& s, InputArray mask=noArray())
|
||||
|
||||
Sets all or some of the array elements to the specified value.
|
||||
|
||||
@@ -1002,7 +1002,7 @@ Mat::setTo
|
||||
|
||||
Mat::reshape
|
||||
----------------
|
||||
.. cpp:function:: Mat Mat::reshape(int cn, int rows=0) const
|
||||
.. ocv:function:: Mat Mat::reshape(int cn, int rows=0) const
|
||||
|
||||
Changes the shape and/or the number of channels of a 2D matrix without copying the data.
|
||||
|
||||
@@ -1017,7 +1017,7 @@ The method makes a new matrix header for ``*this`` elements. The new matrix may
|
||||
|
||||
*
|
||||
No data is copied. That is, this is an O(1) operation. Consequently, if you change the number of rows, or the operation changes the indices of elements row in some other way, the matrix must be continuous. See
|
||||
:cpp:func:`Mat::isContinuous` .
|
||||
:ocv:func:`Mat::isContinuous` .
|
||||
|
||||
For example, if there is a set of 3D points stored as an STL vector, and you want to represent the points as a ``3xN`` matrix, do the following: ::
|
||||
|
||||
@@ -1035,7 +1035,7 @@ For example, if there is a set of 3D points stored as an STL vector, and you wan
|
||||
|
||||
Mat::t
|
||||
----------
|
||||
.. cpp:function:: MatExpr Mat::t() const
|
||||
.. ocv:function:: MatExpr Mat::t() const
|
||||
|
||||
Transposes a matrix.
|
||||
|
||||
@@ -1047,7 +1047,7 @@ The method performs matrix transposition by means of matrix expressions. It does
|
||||
|
||||
Mat::inv
|
||||
------------
|
||||
.. cpp:function:: MatExpr Mat::inv(int method=DECOMP_LU) const
|
||||
.. ocv:function:: MatExpr Mat::inv(int method=DECOMP_LU) const
|
||||
|
||||
Inverses a matrix.
|
||||
|
||||
@@ -1064,7 +1064,7 @@ The method performs a matrix inversion by means of matrix expressions. This mean
|
||||
|
||||
Mat::mul
|
||||
------------
|
||||
.. cpp:function:: MatExpr Mat::mul(InputArray m, double scale=1) const
|
||||
.. ocv:function:: MatExpr Mat::mul(InputArray m, double scale=1) const
|
||||
|
||||
Performs an element-wise multiplication or division of the two matrices.
|
||||
|
||||
@@ -1081,7 +1081,7 @@ Example: ::
|
||||
|
||||
Mat::cross
|
||||
--------------
|
||||
.. cpp:function:: Mat Mat::cross(InputArray m) const
|
||||
.. ocv:function:: Mat Mat::cross(InputArray m) const
|
||||
|
||||
Computes a cross-product of two 3-element vectors.
|
||||
|
||||
@@ -1092,7 +1092,7 @@ The method computes a cross-product of two 3-element vectors. The vectors must b
|
||||
|
||||
Mat::dot
|
||||
------------
|
||||
.. cpp:function:: double Mat::dot(InputArray m) const
|
||||
.. ocv:function:: double Mat::dot(InputArray m) const
|
||||
|
||||
Computes a dot-product of two vectors.
|
||||
|
||||
@@ -1103,9 +1103,9 @@ The method computes a dot-product of two matrices. If the matrices are not singl
|
||||
|
||||
Mat::zeros
|
||||
--------------
|
||||
.. cpp:function:: static MatExpr Mat::zeros(int rows, int cols, int type)
|
||||
.. cpp:function:: static MatExpr Mat::zeros(Size size, int type)
|
||||
.. cpp:function:: static MatExpr Mat::zeros(int ndims, const int* sizes, int type)
|
||||
.. ocv:function:: static MatExpr Mat::zeros(int rows, int cols, int type)
|
||||
.. ocv:function:: static MatExpr Mat::zeros(Size size, int type)
|
||||
.. ocv:function:: static MatExpr Mat::zeros(int ndims, const int* sizes, int type)
|
||||
|
||||
Returns a zero array of the specified size and type.
|
||||
|
||||
@@ -1132,9 +1132,9 @@ In the example above, a new matrix is allocated only if ``A`` is not a 3x3 float
|
||||
|
||||
Mat::ones
|
||||
-------------
|
||||
.. cpp:function:: static MatExpr Mat::ones(int rows, int cols, int type)
|
||||
.. cpp:function:: static MatExpr Mat::ones(Size size, int type)
|
||||
.. cpp:function:: static MatExpr Mat::ones(int ndims, const int* sizes, int type)
|
||||
.. ocv:function:: static MatExpr Mat::ones(int rows, int cols, int type)
|
||||
.. ocv:function:: static MatExpr Mat::ones(Size size, int type)
|
||||
.. ocv:function:: static MatExpr Mat::ones(int ndims, const int* sizes, int type)
|
||||
|
||||
Returns an array of all 1's of the specified size and type.
|
||||
|
||||
@@ -1151,7 +1151,7 @@ Mat::ones
|
||||
:param type: Created matrix type.
|
||||
|
||||
The method returns a Matlab-style 1's array initializer, similarly to
|
||||
:cpp:func:`Mat::zeros`. Note that using this method you can initialize an array with an arbitrary value, using the following Matlab idiom: ::
|
||||
:ocv:func:`Mat::zeros`. Note that using this method you can initialize an array with an arbitrary value, using the following Matlab idiom: ::
|
||||
|
||||
Mat A = Mat::ones(100, 100, CV_8U)*3; // make 100x100 matrix filled with 3.
|
||||
|
||||
@@ -1161,8 +1161,8 @@ The above operation does not form a 100x100 matrix of 1's and then multiply it b
|
||||
|
||||
Mat::eye
|
||||
------------
|
||||
.. cpp:function:: static MatExpr Mat::eye(int rows, int cols, int type)
|
||||
.. cpp:function:: static MatExpr Mat::eye(Size size, int type)
|
||||
.. ocv:function:: static MatExpr Mat::eye(int rows, int cols, int type)
|
||||
.. ocv:function:: static MatExpr Mat::eye(Size size, int type)
|
||||
|
||||
Returns an identity matrix of the specified size and type.
|
||||
|
||||
@@ -1175,8 +1175,8 @@ Mat::eye
|
||||
:param type: Created matrix type.
|
||||
|
||||
The method returns a Matlab-style identity matrix initializer, similarly to
|
||||
:cpp:func:`Mat::zeros`. Similarly to
|
||||
:cpp:func:`Mat::ones`, you can use a scale operation to create a scaled identity matrix efficiently: ::
|
||||
:ocv:func:`Mat::zeros`. Similarly to
|
||||
:ocv:func:`Mat::ones`, you can use a scale operation to create a scaled identity matrix efficiently: ::
|
||||
|
||||
// make a 4x4 diagonal matrix with 0.1's on the diagonal.
|
||||
Mat A = Mat::eye(4, 4, CV_32F)*0.1;
|
||||
@@ -1184,9 +1184,9 @@ The method returns a Matlab-style identity matrix initializer, similarly to
|
||||
|
||||
Mat::create
|
||||
---------------
|
||||
.. cpp:function:: void Mat::create(int rows, int cols, int type)
|
||||
.. cpp:function:: void Mat::create(Size size, int type)
|
||||
.. cpp:function:: void Mat::create(int ndims, const int* sizes, int type)
|
||||
.. ocv:function:: void Mat::create(int rows, int cols, int type)
|
||||
.. ocv:function:: void Mat::create(Size size, int type)
|
||||
.. ocv:function:: void Mat::create(int ndims, const int* sizes, int type)
|
||||
|
||||
Allocates new array data if needed.
|
||||
|
||||
@@ -1206,7 +1206,7 @@ This is one of the key ``Mat`` methods. Most new-style OpenCV functions and meth
|
||||
|
||||
#.
|
||||
If the current array shape and the type match the new ones, return immediately. Otherwise, de-reference the previous data by calling
|
||||
:cpp:func:`Mat::release`.
|
||||
:ocv:func:`Mat::release`.
|
||||
|
||||
#.
|
||||
Initialize the new header.
|
||||
@@ -1238,29 +1238,29 @@ because ``cvtColor`` , as well as the most of OpenCV functions, calls ``Mat::cre
|
||||
|
||||
Mat::addref
|
||||
---------------
|
||||
.. cpp:function:: void Mat::addref()
|
||||
.. ocv:function:: void Mat::addref()
|
||||
|
||||
Increments the reference counter.
|
||||
|
||||
The method increments the reference counter associated with the matrix data. If the matrix header points to an external data set (see
|
||||
:cpp:func:`Mat::Mat` ), the reference counter is NULL, and the method has no effect in this case. Normally, to avoid memory leaks, the method should not be called explicitly. It is called implicitly by the matrix assignment operator. The reference counter increment is an atomic operation on the platforms that support it. Thus, it is safe to operate on the same matrices asynchronously in different threads.
|
||||
:ocv:func:`Mat::Mat` ), the reference counter is NULL, and the method has no effect in this case. Normally, to avoid memory leaks, the method should not be called explicitly. It is called implicitly by the matrix assignment operator. The reference counter increment 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::release
|
||||
----------------
|
||||
.. cpp:function:: void Mat::release()
|
||||
.. ocv:function:: void Mat::release()
|
||||
|
||||
Decrements the reference counter and deallocates the matrix if needed.
|
||||
|
||||
The method decrements the reference counter associated with the matrix data. When the reference counter reaches 0, the matrix data is deallocated and the data and the reference counter pointers are set to NULL's. If the matrix header points to an external data set (see
|
||||
:cpp:func:`Mat::Mat` ), the reference counter is NULL, and the method has no effect in this case.
|
||||
:ocv:func:`Mat::Mat` ), the reference counter is NULL, and the method has no effect in this case.
|
||||
|
||||
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
|
||||
---------------
|
||||
.. cpp:function:: void Mat::resize( size_t sz )
|
||||
.. cpp:function:: void Mat::resize( size_t sz, const Scalar& s )
|
||||
.. ocv:function:: void Mat::resize( size_t sz )
|
||||
.. ocv:function:: void Mat::resize( size_t sz, const Scalar& s )
|
||||
|
||||
Changes the number of matrix rows.
|
||||
|
||||
@@ -1272,7 +1272,7 @@ The methods change the number of matrix rows. If the matrix is reallocated, the
|
||||
|
||||
Mat::reserve
|
||||
---------------
|
||||
.. cpp:function:: void Mat::reserve( size_t sz )
|
||||
.. ocv:function:: void Mat::reserve( size_t sz )
|
||||
|
||||
Reserves space for the certain number of rows.
|
||||
|
||||
@@ -1282,8 +1282,8 @@ The method reserves space for ``sz`` rows. If the matrix already has enough spac
|
||||
|
||||
Mat::push_back
|
||||
--------------
|
||||
.. cpp:function:: template<typename T> void Mat::push_back(const T& elem)
|
||||
.. cpp:function:: void Mat::push_back(const Mat& elem)
|
||||
.. ocv:function:: template<typename T> void Mat::push_back(const T& elem)
|
||||
.. ocv:function:: void Mat::push_back(const Mat& elem)
|
||||
|
||||
Adds elements to the bottom of the matrix.
|
||||
|
||||
@@ -1293,7 +1293,7 @@ The methods add one or more elements to the bottom of the matrix. They emulate t
|
||||
|
||||
Mat::pop_back
|
||||
-------------
|
||||
.. cpp:function:: template<typename T> void Mat::pop_back(size_t nelems=1)
|
||||
.. ocv:function:: template<typename T> void Mat::pop_back(size_t nelems=1)
|
||||
|
||||
Removes elements from the bottom of the matrix.
|
||||
|
||||
@@ -1304,7 +1304,7 @@ The method removes one or more rows from the bottom of the matrix.
|
||||
|
||||
Mat::locateROI
|
||||
------------------
|
||||
.. cpp:function:: void Mat::locateROI( Size& wholeSize, Point& ofs ) const
|
||||
.. ocv:function:: void Mat::locateROI( Size& wholeSize, Point& ofs ) const
|
||||
|
||||
Locates the matrix header within a parent matrix.
|
||||
|
||||
@@ -1313,15 +1313,15 @@ Mat::locateROI
|
||||
:param ofs: Output parameter that contains an offset of ``*this`` inside the whole matrix.
|
||||
|
||||
After you extracted a submatrix from a matrix using
|
||||
:cpp:func:`Mat::row`,
|
||||
:cpp:func:`Mat::col`,
|
||||
:cpp:func:`Mat::rowRange`,
|
||||
:cpp:func:`Mat::colRange` , and others, the resultant submatrix points just to the part of the original big matrix. However, each submatrix contains information (represented by ``datastart`` and ``dataend`` fields) that helps reconstruct the original matrix size and the position of the extracted submatrix within the original matrix. The method ``locateROI`` does exactly that.
|
||||
:ocv:func:`Mat::row`,
|
||||
:ocv:func:`Mat::col`,
|
||||
:ocv:func:`Mat::rowRange`,
|
||||
:ocv:func:`Mat::colRange` , and others, the resultant submatrix points just to the part of the original big matrix. However, each submatrix contains information (represented by ``datastart`` and ``dataend`` fields) that helps reconstruct the original matrix size and the position of the extracted submatrix within the original matrix. The method ``locateROI`` does exactly that.
|
||||
|
||||
|
||||
Mat::adjustROI
|
||||
------------------
|
||||
.. cpp:function:: Mat& Mat::adjustROI( int dtop, int dbottom, int dleft, int dright )
|
||||
.. ocv:function:: Mat& Mat::adjustROI( int dtop, int dbottom, int dleft, int dright )
|
||||
|
||||
Adjusts a submatrix size and position within the parent matrix.
|
||||
|
||||
@@ -1334,7 +1334,7 @@ Mat::adjustROI
|
||||
:param dright: Shift of the right submatrix boundary to the right.
|
||||
|
||||
The method is complimentary to
|
||||
:cpp:func:`Mat::locateROI` . The typical use of these functions is to determine the submatrix position within the parent matrix and then shift the position somehow. Typically, it can be required for filtering operations when pixels outside of the ROI should be taken into account. When all the method parameters are positive, the ROI needs to grow in all directions by the specified amount, for example: ::
|
||||
:ocv:func:`Mat::locateROI` . The typical use of these functions is to determine the submatrix position within the parent matrix and then shift the position somehow. Typically, it can be required for filtering operations when pixels outside of the ROI should be taken into account. When all the method parameters are positive, the ROI needs to grow in all directions by the specified amount, for example: ::
|
||||
|
||||
A.adjustROI(2, 2, 2, 2);
|
||||
|
||||
@@ -1344,19 +1344,19 @@ In this example, the matrix size is increased by 4 elements in each direction. T
|
||||
It is your responsibility to make sure ``adjustROI`` does not cross the parent matrix boundary. If it does, the function signals an error.
|
||||
|
||||
The function is used internally by the OpenCV filtering functions, like
|
||||
:cpp:func:`filter2D` , morphological operations, and so on.
|
||||
:ocv:func:`filter2D` , morphological operations, and so on.
|
||||
|
||||
See Also:
|
||||
:cpp:func:`copyMakeBorder`
|
||||
:ocv:func:`copyMakeBorder`
|
||||
|
||||
|
||||
Mat::operator()
|
||||
-------------------
|
||||
.. cpp:function:: Mat Mat::operator()( Range rowRange, Range colRange ) const
|
||||
.. ocv:function:: Mat Mat::operator()( Range rowRange, Range colRange ) const
|
||||
|
||||
.. cpp:function:: Mat Mat::operator()( const Rect& roi ) const
|
||||
.. ocv:function:: Mat Mat::operator()( const Rect& roi ) const
|
||||
|
||||
.. cpp:function:: Mat Mat::operator()( const Ranges* ranges ) const
|
||||
.. ocv:function:: Mat Mat::operator()( const Ranges* ranges ) const
|
||||
|
||||
Extracts a rectangular submatrix.
|
||||
|
||||
@@ -1369,15 +1369,15 @@ Mat::operator()
|
||||
:param ranges: Array of selected ranges along each array dimension.
|
||||
|
||||
The operators make a new header for the specified sub-array of ``*this`` . They are the most generalized forms of
|
||||
:cpp:func:`Mat::row`,
|
||||
:cpp:func:`Mat::col`,
|
||||
:cpp:func:`Mat::rowRange`, and
|
||||
:cpp:func:`Mat::colRange` . For example, ``A(Range(0, 10), Range::all())`` is equivalent to ``A.rowRange(0, 10)`` . Similarly to all of the above, the operators are O(1) operations, that is, no matrix data is copied.
|
||||
:ocv:func:`Mat::row`,
|
||||
:ocv:func:`Mat::col`,
|
||||
:ocv:func:`Mat::rowRange`, and
|
||||
:ocv:func:`Mat::colRange` . For example, ``A(Range(0, 10), Range::all())`` is equivalent to ``A.rowRange(0, 10)`` . Similarly to all of the above, the operators are O(1) operations, that is, no matrix data is copied.
|
||||
|
||||
|
||||
Mat::operator CvMat
|
||||
-----------------------
|
||||
.. cpp:function:: Mat::operator CvMat() const
|
||||
.. ocv:function:: Mat::operator CvMat() const
|
||||
|
||||
Creates the ``CvMat`` header for the matrix.
|
||||
|
||||
@@ -1395,7 +1395,7 @@ where ``mycvOldFunc`` is a function written to work with OpenCV 1.x data structu
|
||||
|
||||
Mat::operator IplImage
|
||||
--------------------------
|
||||
.. cpp:function:: Mat::operator IplImage() const
|
||||
.. ocv:function:: Mat::operator IplImage() const
|
||||
|
||||
Creates the ``IplImage`` header for the matrix.
|
||||
|
||||
@@ -1403,7 +1403,7 @@ The operator creates the ``IplImage`` header for the matrix without copying the
|
||||
|
||||
Mat::total
|
||||
--------------
|
||||
.. cpp:function:: size_t Mat::total() const
|
||||
.. ocv:function:: size_t Mat::total() const
|
||||
|
||||
Returns the total number of array elements.
|
||||
|
||||
@@ -1411,14 +1411,14 @@ The method returns the number of array elements (a number of pixels if the array
|
||||
|
||||
Mat::isContinuous
|
||||
---------------------
|
||||
.. cpp:function:: bool Mat::isContinuous() const
|
||||
.. ocv:function:: bool Mat::isContinuous() const
|
||||
|
||||
Reports whether the matrix is continuous or not.
|
||||
|
||||
The method returns ``true`` if the matrix elements are stored continuously without gaps at the end of each row. Otherwise, it returns ``false``. Obviously, ``1x1`` or ``1xN`` matrices are always continuous. Matrices created with
|
||||
:cpp:func:`Mat::create` are always continuous. But if you extract a part of the matrix using
|
||||
:cpp:func:`Mat::col`,
|
||||
:cpp:func:`Mat::diag` , and so on, or constructed a matrix header for externally allocated data, such matrices may no longer have this property.
|
||||
:ocv:func:`Mat::create` are always continuous. But if you extract a part of the matrix using
|
||||
:ocv:func:`Mat::col`,
|
||||
:ocv:func:`Mat::diag` , and so on, or constructed a matrix header for externally allocated data, such matrices may no longer have this property.
|
||||
|
||||
The continuity flag is stored as a bit in the ``Mat::flags`` field and is computed automatically when you construct a matrix header. Thus, the continuity check is a very fast operation, though theoretically it could be done as follows: ::
|
||||
|
||||
@@ -1477,12 +1477,12 @@ The method is used in quite a few of OpenCV functions. The point is that element
|
||||
This approach, while being very simple, can boost the performance of a simple element-operation by 10-20 percents, especially if the image is rather small and the operation is quite simple.
|
||||
|
||||
Another OpenCV idiom in this function, a call of
|
||||
:cpp:func:`Mat::create` for the destination array, that allocates the destination array unless it already has the proper size and type. And while the newly allocated arrays are always continuous, you still need to check the destination array because :cpp:func:`create` does not always allocate a new matrix.
|
||||
:ocv:func:`Mat::create` for the destination array, that allocates the destination array unless it already has the proper size and type. And while the newly allocated arrays are always continuous, you still need to check the destination array because :ocv:func:`create` does not always allocate a new matrix.
|
||||
|
||||
|
||||
Mat::elemSize
|
||||
-----------------
|
||||
.. cpp:function:: size_t Mat::elemSize(void) const
|
||||
.. ocv:function:: size_t Mat::elemSize(void) const
|
||||
|
||||
Returns the matrix element size in bytes.
|
||||
|
||||
@@ -1491,7 +1491,7 @@ The method returns the matrix element size in bytes. For example, if the matrix
|
||||
|
||||
Mat::elemSize1
|
||||
------------------
|
||||
.. cpp:function:: size_t Mat::elemSize() const
|
||||
.. ocv:function:: size_t Mat::elemSize() const
|
||||
|
||||
Returns the size of each matrix element channel in bytes.
|
||||
|
||||
@@ -1500,7 +1500,7 @@ The method returns the matrix element channel size in bytes, that is, it ignores
|
||||
|
||||
Mat::type
|
||||
-------------
|
||||
.. cpp:function:: int Mat::type() const
|
||||
.. ocv:function:: int Mat::type() const
|
||||
|
||||
Returns the type of a matrix element.
|
||||
|
||||
@@ -1509,7 +1509,7 @@ The method returns a matrix element type. This is an identifier compatible with
|
||||
|
||||
Mat::depth
|
||||
--------------
|
||||
.. cpp:function:: int Mat::depth() const
|
||||
.. ocv:function:: int Mat::depth() const
|
||||
|
||||
Returns the depth of a matrix element.
|
||||
|
||||
@@ -1532,7 +1532,7 @@ The method returns the identifier of the matrix element depth (the type of each
|
||||
|
||||
Mat::channels
|
||||
-----------------
|
||||
.. cpp:function:: int Mat::channels() const
|
||||
.. ocv:function:: int Mat::channels() const
|
||||
|
||||
Returns the number of matrix channels.
|
||||
|
||||
@@ -1541,17 +1541,17 @@ The method returns the number of matrix channels.
|
||||
|
||||
Mat::step1
|
||||
--------------
|
||||
.. cpp:function:: size_t Mat::step1() const
|
||||
.. ocv:function:: size_t Mat::step1() const
|
||||
|
||||
Returns a normalized step.
|
||||
|
||||
The method returns a matrix step divided by
|
||||
:cpp:func:`Mat::elemSize1()` . It can be useful to quickly access an arbitrary matrix element.
|
||||
:ocv:func:`Mat::elemSize1()` . It can be useful to quickly access an arbitrary matrix element.
|
||||
|
||||
|
||||
Mat::size
|
||||
-------------
|
||||
.. cpp:function:: Size Mat::size() const
|
||||
.. ocv:function:: Size Mat::size() const
|
||||
|
||||
Returns a matrix size.
|
||||
|
||||
@@ -1560,7 +1560,7 @@ The method returns a matrix size: ``Size(cols, rows)`` .
|
||||
|
||||
Mat::empty
|
||||
--------------
|
||||
.. cpp:function:: bool Mat::empty() const
|
||||
.. ocv:function:: bool Mat::empty() const
|
||||
|
||||
Returns ``true`` if the array has no elemens.
|
||||
|
||||
@@ -1569,43 +1569,43 @@ The method returns ``true`` if ``Mat::total()`` is 0 or if ``Mat::data`` is NULL
|
||||
|
||||
Mat::ptr
|
||||
------------
|
||||
.. cpp:function:: uchar* Mat::ptr(int i=0)
|
||||
.. ocv:function:: uchar* Mat::ptr(int i=0)
|
||||
|
||||
.. cpp:function:: const uchar* Mat::ptr(int i=0) const
|
||||
.. ocv:function:: const uchar* Mat::ptr(int i=0) const
|
||||
|
||||
.. cpp:function:: template<typename _Tp> _Tp* Mat::ptr(int i=0)
|
||||
.. ocv:function:: template<typename _Tp> _Tp* Mat::ptr(int i=0)
|
||||
|
||||
.. cpp:function:: template<typename _Tp> const _Tp* Mat::ptr(int i=0) const
|
||||
.. ocv:function:: template<typename _Tp> const _Tp* Mat::ptr(int i=0) const
|
||||
|
||||
Returns a pointer to the specified matrix row.
|
||||
|
||||
:param i: A 0-based row index.
|
||||
|
||||
The methods return ``uchar*`` or typed pointer to the specified matrix row. See the sample in
|
||||
:cpp:func:`Mat::isContinuous` () to know how to use these methods.
|
||||
:ocv:func:`Mat::isContinuous` () to know how to use these methods.
|
||||
|
||||
|
||||
Mat::at
|
||||
-----------
|
||||
.. cpp:function:: template<typename T> T& Mat::at(int i) const
|
||||
.. ocv:function:: template<typename T> T& Mat::at(int i) const
|
||||
|
||||
.. cpp:function:: template<typename T> const T& Mat::at(int i) const
|
||||
.. ocv:function:: template<typename T> const T& Mat::at(int i) const
|
||||
|
||||
.. cpp:function:: template<typename T> T& Mat::at(int i, int j)
|
||||
.. ocv:function:: template<typename T> T& Mat::at(int i, int j)
|
||||
|
||||
.. cpp:function:: template<typename T> const T& Mat::at(int i, int j) const
|
||||
.. ocv:function:: template<typename T> const T& Mat::at(int i, int j) const
|
||||
|
||||
.. cpp:function:: template<typename T> T& Mat::at(Point pt)
|
||||
.. ocv:function:: template<typename T> T& Mat::at(Point pt)
|
||||
|
||||
.. cpp:function:: template<typename T> const T& Mat::at(Point pt) const
|
||||
.. ocv:function:: template<typename T> const T& Mat::at(Point pt) const
|
||||
|
||||
.. cpp:function:: template<typename T> T& Mat::at(int i, int j, int k)
|
||||
.. ocv:function:: template<typename T> T& Mat::at(int i, int j, int k)
|
||||
|
||||
.. cpp:function:: template<typename T> const T& Mat::at(int i, int j, int k) const
|
||||
.. ocv:function:: template<typename T> const T& Mat::at(int i, int j, int k) const
|
||||
|
||||
.. cpp:function:: template<typename T> T& Mat::at(const int* idx)
|
||||
.. ocv:function:: template<typename T> T& Mat::at(const int* idx)
|
||||
|
||||
.. cpp:function:: template<typename T> const T& Mat::at(const int* idx) const
|
||||
.. ocv:function:: template<typename T> const T& Mat::at(const int* idx) const
|
||||
|
||||
Returns a reference to the specified array element.
|
||||
|
||||
@@ -1630,7 +1630,7 @@ The example below initializes a Hilbert matrix: ::
|
||||
|
||||
Mat::begin
|
||||
--------------
|
||||
.. cpp:function:: template<typename _Tp> MatIterator_<_Tp> Mat::begin() template<typename _Tp> MatConstIterator_<_Tp> Mat::begin() const
|
||||
.. ocv:function:: template<typename _Tp> MatIterator_<_Tp> Mat::begin() template<typename _Tp> MatConstIterator_<_Tp> Mat::begin() const
|
||||
|
||||
Returns the matrix iterator and sets it to the first matrix element.
|
||||
|
||||
@@ -1669,8 +1669,8 @@ The methods return the matrix read-only or read-write iterators. The use of matr
|
||||
|
||||
Mat::end
|
||||
------------
|
||||
.. cpp:function:: template<typename _Tp> MatIterator_<_Tp> Mat::end()
|
||||
.. cpp:function:: template<typename _Tp> MatConstIterator_<_Tp> Mat::end() const
|
||||
.. ocv:function:: template<typename _Tp> MatIterator_<_Tp> Mat::end()
|
||||
.. ocv:function:: template<typename _Tp> MatConstIterator_<_Tp> Mat::end() const
|
||||
|
||||
Returns the matrix iterator and sets it to the after-last matrix element.
|
||||
|
||||
@@ -1678,10 +1678,10 @@ The methods return the matrix read-only or read-write iterators, set to the poin
|
||||
|
||||
Mat\_
|
||||
-----
|
||||
.. cpp:class:: Mat_
|
||||
.. ocv:class:: Mat_
|
||||
|
||||
Template matrix class derived from
|
||||
:cpp:class:`Mat` . ::
|
||||
:ocv:class:`Mat` . ::
|
||||
|
||||
template<typename _Tp> class Mat_ : public Mat
|
||||
{
|
||||
@@ -1729,7 +1729,7 @@ To use ``Mat_`` for multi-channel images/matrices, pass ``Vec`` as a ``Mat_`` pa
|
||||
|
||||
NAryMatIterator
|
||||
--------------
|
||||
.. cpp:class:: NAryMatIterator
|
||||
.. ocv:class:: NAryMatIterator
|
||||
|
||||
n-ary multi-dimensional array iterator. ::
|
||||
|
||||
@@ -1800,7 +1800,7 @@ The example below illustrates how you can compute a normalized and threshold 3D
|
||||
|
||||
SparseMat
|
||||
---------
|
||||
.. cpp:class:: SparseMat
|
||||
.. ocv:class:: SparseMat
|
||||
|
||||
Sparse n-dimensional array. ::
|
||||
|
||||
@@ -1999,7 +1999,7 @@ Sparse n-dimensional array. ::
|
||||
|
||||
|
||||
The class ``SparseMat`` represents multi-dimensional sparse numerical arrays. Such a sparse array can store elements of any type that
|
||||
:cpp: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:
|
||||
: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:
|
||||
|
||||
*
|
||||
Query operations ( ``SparseMat::ptr`` and the higher-level ``SparseMat::ref``, ``SparseMat::value`` and ``SparseMat::find`` ), for example:
|
||||
@@ -2020,7 +2020,7 @@ The class ``SparseMat`` represents multi-dimensional sparse numerical arrays. Su
|
||||
..
|
||||
|
||||
*
|
||||
Sparse matrix iterators. They are similar to ``MatIterator`` but different from :cpp:class:`NAryMatIterator`. That is, the iteration loop is familiar to STL users:
|
||||
Sparse matrix iterators. They are similar to ``MatIterator`` but different from :ocv:class:`NAryMatIterator`. That is, the iteration loop is familiar to STL users:
|
||||
|
||||
::
|
||||
|
||||
@@ -2080,10 +2080,10 @@ The class ``SparseMat`` represents multi-dimensional sparse numerical arrays. Su
|
||||
|
||||
SparseMat\_
|
||||
-----------
|
||||
.. cpp:class:: SparseMat_
|
||||
.. ocv:class:: SparseMat_
|
||||
|
||||
Template sparse n-dimensional array class derived from
|
||||
:cpp:class:`SparseMat` ::
|
||||
:ocv:class:`SparseMat` ::
|
||||
|
||||
template<typename _Tp> class SparseMat_ : public SparseMat
|
||||
{
|
||||
@@ -2133,7 +2133,7 @@ Template sparse n-dimensional array class derived from
|
||||
SparseMatConstIterator_<_Tp> end() const;
|
||||
};
|
||||
|
||||
``SparseMat_`` is a thin wrapper on top of :cpp:class:`SparseMat` created in the same way as ``Mat_`` .
|
||||
``SparseMat_`` is a thin wrapper on top of :ocv:class:`SparseMat` created in the same way as ``Mat_`` .
|
||||
It simplifies notation of some operations. ::
|
||||
|
||||
int sz[] = {10, 20, 30};
|
||||
|
@@ -10,7 +10,7 @@ Clustering
|
||||
kmeans
|
||||
------
|
||||
|
||||
.. cpp:function:: double kmeans( InputArray samples, int clusterCount, InputOutputArray labels, TermCriteria termcrit, int attempts, int flags, OutputArray centers=noArray() )
|
||||
.. ocv:function:: double kmeans( InputArray samples, int clusterCount, InputOutputArray labels, TermCriteria termcrit, int attempts, int flags, OutputArray centers=noArray() )
|
||||
|
||||
Finds centers of clusters and groups input samples around the clusters.
|
||||
|
||||
@@ -57,9 +57,9 @@ attempts to 1, initialize labels each time using a custom algorithm, pass them w
|
||||
|
||||
partition
|
||||
-------------
|
||||
.. cpp:function:: template<typename _Tp, class _EqPredicate> int
|
||||
.. ocv:function:: template<typename _Tp, class _EqPredicate> int
|
||||
|
||||
.. cpp:function:: partition( const vector<_Tp>& vec, vector<int>& labels, _EqPredicate predicate=_EqPredicate())
|
||||
.. ocv:function:: partition( const vector<_Tp>& vec, vector<int>& labels, _EqPredicate predicate=_EqPredicate())
|
||||
|
||||
Splits an element set into equivalency classes.
|
||||
|
||||
|
@@ -10,7 +10,7 @@ with ``CV_RGB`` or the :ref:`Scalar` constructor
|
||||
) for color
|
||||
images and brightness for grayscale images. For color images, the channel ordering
|
||||
is normally *Blue, Green, Red*.
|
||||
This is what :cpp:func:`imshow`, :cpp:func:`imread`, and :cpp:func:`imwrite` expect.
|
||||
This is what :ocv:func:`imshow`, :ocv:func:`imread`, and :ocv:func:`imwrite` expect.
|
||||
So, if you form a color using the
|
||||
:ref:`Scalar` constructor, it should look like:
|
||||
|
||||
@@ -19,7 +19,7 @@ So, if you form a color using the
|
||||
\texttt{Scalar} (blue \_ component, green \_ component, red \_ component[, alpha \_ component])
|
||||
|
||||
If you are using your own image rendering and I/O functions, you can use any channel ordering. The drawing functions process each channel independently and do not depend on the channel order or even on the used color space. The whole image can be converted from BGR to RGB or to a different color space using
|
||||
:cpp:func:`cvtColor` .
|
||||
:ocv:func:`cvtColor` .
|
||||
|
||||
If a drawn figure is partially or completely outside the image, the drawing functions clip it. Also, many drawing functions can handle pixel coordinates specified with sub-pixel accuracy. This means that the coordinates can be passed as fixed-point numbers encoded as integers. The number of fractional bits is specified by the ``shift`` parameter and the real point coordinates are calculated as
|
||||
:math:`\texttt{Point}(x,y)\rightarrow\texttt{Point2f}(x*2^{-shift},y*2^{-shift})` . This feature is especially effective when rendering antialiased shapes.
|
||||
@@ -32,7 +32,7 @@ The functions do not support alpha-transparency when the target image is 4-chann
|
||||
|
||||
circle
|
||||
----------
|
||||
.. cpp:function:: void circle(Mat& img, Point center, int radius, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
|
||||
.. ocv:function:: void circle(Mat& img, Point center, int radius, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
|
||||
|
||||
Draws a circle.
|
||||
|
||||
@@ -46,7 +46,7 @@ circle
|
||||
|
||||
:param thickness: Thickness of the circle outline if positive. Negative thickness means that a filled circle is to be drawn.
|
||||
|
||||
:param lineType: Type of the circle boundary. See :cpp:func:`line` description.
|
||||
:param lineType: Type of the circle boundary. See :ocv:func:`line` description.
|
||||
|
||||
:param shift: Number of fractional bits in the center's coordinates and in the radius value.
|
||||
|
||||
@@ -56,9 +56,9 @@ The function ``circle`` draws a simple or filled circle with a given center and
|
||||
|
||||
clipLine
|
||||
------------
|
||||
.. cpp:function:: bool clipLine(Size imgSize, Point& pt1, Point& pt2)
|
||||
.. ocv:function:: bool clipLine(Size imgSize, Point& pt1, Point& pt2)
|
||||
|
||||
.. cpp:function:: bool clipLine(Rect imgRect, Point& pt1, Point& pt2)
|
||||
.. ocv:function:: bool clipLine(Rect imgRect, Point& pt1, Point& pt2)
|
||||
|
||||
Clips the line against the image rectangle.
|
||||
|
||||
@@ -77,9 +77,9 @@ They return ``false`` if the line segment is completely outside the rectangle. O
|
||||
|
||||
ellipse
|
||||
-----------
|
||||
.. cpp:function:: void ellipse(Mat& img, Point center, Size axes, double angle, double startAngle, double endAngle, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
|
||||
.. ocv:function:: void ellipse(Mat& img, Point center, Size axes, double angle, double startAngle, double endAngle, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
|
||||
|
||||
.. cpp:function:: void ellipse(Mat& img, const RotatedRect& box, const Scalar& color, int thickness=1, int lineType=8)
|
||||
.. ocv:function:: void ellipse(Mat& img, const RotatedRect& box, const Scalar& color, int thickness=1, int lineType=8)
|
||||
|
||||
Draws a simple or thick elliptic arc or fills an ellipse sector.
|
||||
|
||||
@@ -101,15 +101,15 @@ ellipse
|
||||
|
||||
:param thickness: Thickness of the ellipse arc outline, if positive. Otherwise, this indicates that a filled ellipse sector is to be drawn.
|
||||
|
||||
:param lineType: Type of the ellipse boundary. See :cpp:func:`line` description.
|
||||
:param lineType: Type of the ellipse boundary. See :ocv:func:`line` description.
|
||||
|
||||
:param shift: Number of fractional bits in the center's coordinates and axes' values.
|
||||
|
||||
The functions ``ellipse`` with less parameters draw an ellipse outline, a filled ellipse, an elliptic arc, or a filled ellipse sector.
|
||||
A piecewise-linear curve is used to approximate the elliptic arc boundary. If you need more control of the ellipse rendering, you can retrieve the curve using
|
||||
:cpp:func:`ellipse2Poly` and then render it with
|
||||
:cpp:func:`polylines` or fill it with
|
||||
:cpp:func:`fillPoly` . If you use the first variant of the function and want to draw the whole ellipse, not an arc, pass ``startAngle=0`` and ``endAngle=360`` . The picture below explains the meaning of the parameters.
|
||||
:ocv:func:`ellipse2Poly` and then render it with
|
||||
:ocv:func:`polylines` or fill it with
|
||||
:ocv:func:`fillPoly` . If you use the first variant of the function and want to draw the whole ellipse, not an arc, pass ``startAngle=0`` and ``endAngle=360`` . The picture below explains the meaning of the parameters.
|
||||
|
||||
**Figure 1. Parameters of Elliptic Arc**
|
||||
|
||||
@@ -119,15 +119,15 @@ A piecewise-linear curve is used to approximate the elliptic arc boundary. If yo
|
||||
|
||||
ellipse2Poly
|
||||
----------------
|
||||
.. cpp:function:: void ellipse2Poly( Point center, Size axes, int angle, int startAngle, int endAngle, int delta, vector<Point>& pts )
|
||||
.. ocv:function:: void ellipse2Poly( Point center, Size axes, int angle, int startAngle, int endAngle, int delta, vector<Point>& pts )
|
||||
|
||||
Approximates an elliptic arc with a polyline.
|
||||
|
||||
:param center: Center of the arc.
|
||||
|
||||
:param axes: Half-sizes of the arc. See :cpp:func:`ellipse` for details.
|
||||
:param axes: Half-sizes of the arc. See :ocv:func:`ellipse` for details.
|
||||
|
||||
:param angle: Rotation angle of the ellipse in degrees. See :cpp:func:`ellipse` for details.
|
||||
:param angle: Rotation angle of the ellipse in degrees. See :ocv:func:`ellipse` for details.
|
||||
|
||||
:param startAngle: Starting angle of the elliptic arc in degrees.
|
||||
|
||||
@@ -138,13 +138,13 @@ ellipse2Poly
|
||||
:param pts: Output vector of polyline vertices.
|
||||
|
||||
The function ``ellipse2Poly`` computes the vertices of a polyline that approximates the specified elliptic arc. It is used by
|
||||
:cpp:func:`ellipse` .
|
||||
:ocv:func:`ellipse` .
|
||||
|
||||
.. index:: fillConvexPoly
|
||||
|
||||
fillConvexPoly
|
||||
------------------
|
||||
.. cpp:function:: void fillConvexPoly(Mat& img, const Point* pts, int npts, const Scalar& color, int lineType=8, int shift=0)
|
||||
.. ocv:function:: void fillConvexPoly(Mat& img, const Point* pts, int npts, const Scalar& color, int lineType=8, int shift=0)
|
||||
|
||||
Fills a convex polygon.
|
||||
|
||||
@@ -156,7 +156,7 @@ fillConvexPoly
|
||||
|
||||
:param color: Polygon color.
|
||||
|
||||
:param lineType: Type of the polygon boundaries. See :cpp:func:`line` description.
|
||||
:param lineType: Type of the polygon boundaries. See :ocv:func:`line` description.
|
||||
|
||||
:param shift: Number of fractional bits in the vertex coordinates.
|
||||
|
||||
@@ -168,7 +168,7 @@ that is, a polygon whose contour intersects every horizontal line (scan line) tw
|
||||
|
||||
fillPoly
|
||||
------------
|
||||
.. cpp:function:: void fillPoly(Mat& img, const Point** pts, const int* npts, int ncontours, const Scalar& color, int lineType=8, int shift=0, Point offset=Point() )
|
||||
.. ocv:function:: void fillPoly(Mat& img, const Point** pts, const int* npts, int ncontours, const Scalar& color, int lineType=8, int shift=0, Point offset=Point() )
|
||||
|
||||
Fills the area bounded by one or more polygons.
|
||||
|
||||
@@ -182,7 +182,7 @@ fillPoly
|
||||
|
||||
:param color: Polygon color.
|
||||
|
||||
:param lineType: Type of the polygon boundaries. See :cpp:func:`line` description.
|
||||
:param lineType: Type of the polygon boundaries. See :ocv:func:`line` description.
|
||||
|
||||
:param shift: Number of fractional bits in the vertex coordinates.
|
||||
|
||||
@@ -193,17 +193,17 @@ areas with holes, contours with self-intersections (some of thier parts), and so
|
||||
|
||||
getTextSize
|
||||
---------------
|
||||
.. cpp:function:: Size getTextSize(const string& text, int fontFace, double fontScale, int thickness, int* baseLine)
|
||||
.. ocv:function:: Size getTextSize(const string& text, int fontFace, double fontScale, int thickness, int* baseLine)
|
||||
|
||||
Calculates the width and height of a text string.
|
||||
|
||||
:param text: Input text string.
|
||||
|
||||
:param fontFace: Font to use. See :cpp:func:`putText` for details.
|
||||
:param fontFace: Font to use. See :ocv:func:`putText` for details.
|
||||
|
||||
:param fontScale: Font scale. See :cpp:func:`putText` for details.
|
||||
:param fontScale: Font scale. See :ocv:func:`putText` for details.
|
||||
|
||||
:param thickness: Thickness of lines used to render the text. See :cpp:func:`putText` for details.
|
||||
:param thickness: Thickness of lines used to render the text. See :ocv:func:`putText` for details.
|
||||
|
||||
:param baseLine: Output parameter - y-coordinate of the baseline relative to the bottom-most text point.
|
||||
|
||||
@@ -244,7 +244,7 @@ That is, the following code renders some text, the tight box surrounding it, and
|
||||
|
||||
line
|
||||
--------
|
||||
.. cpp:function:: void line(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
|
||||
.. ocv:function:: void line(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
|
||||
|
||||
Draws a line segment connecting two points.
|
||||
|
||||
@@ -321,9 +321,9 @@ The number of pixels along the line is stored in ``LineIterator::count`` . ::
|
||||
|
||||
rectangle
|
||||
-------------
|
||||
.. cpp:function:: void rectangle(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
|
||||
.. ocv:function:: void rectangle(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
|
||||
|
||||
.. cpp:function:: void rectangle(Mat& img, Rect r, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
|
||||
.. ocv:function:: void rectangle(Mat& img, Rect r, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
|
||||
|
||||
Draws a simple, thick, or filled up-right rectangle.
|
||||
|
||||
@@ -339,7 +339,7 @@ rectangle
|
||||
|
||||
:param thickness: Thickness of lines that make up the rectangle. Negative values, like ``CV_FILLED`` , mean that the function has to draw a filled rectangle.
|
||||
|
||||
:param lineType: Type of the line. See :cpp:func:`line` description.
|
||||
:param lineType: Type of the line. See :ocv:func:`line` description.
|
||||
|
||||
:param shift: Number of fractional bits in the point coordinates.
|
||||
|
||||
@@ -349,7 +349,7 @@ The function ``rectangle`` draws a rectangle outline or a filled rectangle whose
|
||||
|
||||
polylines
|
||||
-------------
|
||||
.. cpp:function:: void polylines(Mat& img, const Point** pts, const int* npts, int ncontours, bool isClosed, const Scalar& color, int thickness=1, int lineType=8, int shift=0 )
|
||||
.. ocv:function:: void polylines(Mat& img, const Point** pts, const int* npts, int ncontours, bool isClosed, const Scalar& color, int thickness=1, int lineType=8, int shift=0 )
|
||||
|
||||
Draws several polygonal curves.
|
||||
|
||||
@@ -367,7 +367,7 @@ polylines
|
||||
|
||||
:param thickness: Thickness of the polyline edges.
|
||||
|
||||
:param lineType: Type of the line segments. See :cpp:func:`line` description.
|
||||
:param lineType: Type of the line segments. See :ocv:func:`line` description.
|
||||
|
||||
:param shift: Number of fractional bits in the vertex coordinates.
|
||||
|
||||
@@ -377,7 +377,7 @@ The function ``polylines`` draws one or more polygonal curves.
|
||||
|
||||
putText
|
||||
-----------
|
||||
.. cpp:function:: void putText( Mat& img, const string& text, Point org, int fontFace, double fontScale, Scalar color, int thickness=1, int lineType=8, bool bottomLeftOrigin=false )
|
||||
.. ocv:function:: void putText( Mat& img, const string& text, Point org, int fontFace, double fontScale, Scalar color, int thickness=1, int lineType=8, bool bottomLeftOrigin=false )
|
||||
|
||||
Draws a text string.
|
||||
|
||||
@@ -403,5 +403,5 @@ putText
|
||||
The function ``putText`` renders the specified text string in the image.
|
||||
Symbols that cannot be rendered using the specified font are
|
||||
replaced by question marks. See
|
||||
:cpp:func:`getTextSize` for a text rendering code example.
|
||||
:ocv:func:`getTextSize` for a text rendering code example.
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@ Utility and System Functions and Macros
|
||||
|
||||
alignPtr
|
||||
------------
|
||||
.. cpp:function:: template<typename _Tp> _Tp* alignPtr(_Tp* ptr, int n=sizeof(_Tp))
|
||||
.. ocv:function:: template<typename _Tp> _Tp* alignPtr(_Tp* ptr, int n=sizeof(_Tp))
|
||||
|
||||
Aligns a pointer to the specified number of bytes.
|
||||
|
||||
@@ -25,7 +25,7 @@ The function returns the aligned pointer of the same type as the input pointer:
|
||||
|
||||
alignSize
|
||||
-------------
|
||||
.. cpp:function:: size_t alignSize(size_t sz, int n)
|
||||
.. ocv:function:: size_t alignSize(size_t sz, int n)
|
||||
|
||||
Aligns a buffer size to the specified number of bytes.
|
||||
|
||||
@@ -43,7 +43,7 @@ The function returns the minimum number that is greater or equal to ``sz`` and i
|
||||
|
||||
allocate
|
||||
------------
|
||||
.. cpp:function:: template<typename _Tp> _Tp* allocate(size_t n)
|
||||
.. ocv:function:: template<typename _Tp> _Tp* allocate(size_t n)
|
||||
|
||||
Allocates an array of elements.
|
||||
|
||||
@@ -55,7 +55,7 @@ The generic function ``allocate`` allocates a buffer for the specified number of
|
||||
|
||||
deallocate
|
||||
--------------
|
||||
.. cpp:function:: template<typename _Tp> void deallocate(_Tp* ptr, size_t n)
|
||||
.. ocv:function:: template<typename _Tp> void deallocate(_Tp* ptr, size_t n)
|
||||
|
||||
Deallocates an array of elements.
|
||||
|
||||
@@ -64,8 +64,8 @@ deallocate
|
||||
:param n: Number of elements in the buffer.
|
||||
|
||||
The generic function ``deallocate`` deallocates the buffer allocated with
|
||||
:cpp:func:`allocate` . The number of elements must match the number passed to
|
||||
:cpp:func:`allocate` .
|
||||
:ocv:func:`allocate` . The number of elements must match the number passed to
|
||||
:ocv:func:`allocate` .
|
||||
|
||||
.. index:: CV_Assert
|
||||
|
||||
@@ -73,7 +73,7 @@ The generic function ``deallocate`` deallocates the buffer allocated with
|
||||
|
||||
CV_Assert
|
||||
---------
|
||||
.. cpp:function:: CV_Assert(expr)
|
||||
.. ocv:function:: CV_Assert(expr)
|
||||
|
||||
Checks a condition at runtime. ::
|
||||
|
||||
@@ -84,17 +84,17 @@ CV_Assert
|
||||
:param expr: Expression to check.
|
||||
|
||||
The macros ``CV_Assert`` and ``CV_DbgAssert`` evaluate the specified expression. If it is 0, the macros raise an error (see
|
||||
:cpp:func:`error` ). The macro ``CV_Assert`` checks the condition in both Debug and Release configurations, while ``CV_DbgAssert`` is only retained in the Debug configuration.
|
||||
:ocv:func:`error` ). The macro ``CV_Assert`` checks the condition in both Debug and Release configurations, while ``CV_DbgAssert`` is only retained in the Debug configuration.
|
||||
|
||||
.. index:: error
|
||||
|
||||
error
|
||||
---------
|
||||
.. cpp:function:: void error( const Exception& exc )
|
||||
.. ocv:function:: void error( const Exception& exc )
|
||||
|
||||
.. cpp:function:: #define CV_Error( code, msg ) <...>
|
||||
.. ocv:function:: #define CV_Error( code, msg ) <...>
|
||||
|
||||
.. cpp:function:: #define CV_Error_( code, args ) <...>
|
||||
.. ocv:function:: #define CV_Error_( code, args ) <...>
|
||||
|
||||
Signals an error and raises an exception.
|
||||
|
||||
@@ -148,13 +148,13 @@ Exception class passed to error ::
|
||||
};
|
||||
|
||||
The class ``Exception`` encapsulates all or almost all the necessary information about the error happened in the program. The exception is usually constructed and thrown implicitly via ``CV_Error`` and ``CV_Error_`` macros. See
|
||||
:cpp:func:`error` .
|
||||
:ocv:func:`error` .
|
||||
|
||||
.. index:: fastMalloc
|
||||
|
||||
fastMalloc
|
||||
--------------
|
||||
.. cpp:function:: void* fastMalloc(size_t size)
|
||||
.. ocv:function:: void* fastMalloc(size_t size)
|
||||
|
||||
Allocates an aligned memory buffer.
|
||||
|
||||
@@ -166,74 +166,74 @@ The function allocates the buffer of the specified size and returns it. When the
|
||||
|
||||
fastFree
|
||||
------------
|
||||
.. cpp:function:: void fastFree(void* ptr)
|
||||
.. ocv:function:: void fastFree(void* ptr)
|
||||
|
||||
Deallocates a memory buffer.
|
||||
|
||||
:param ptr: Pointer to the allocated buffer.
|
||||
|
||||
The function deallocates the buffer allocated with
|
||||
:cpp:func:`fastMalloc` .
|
||||
:ocv:func:`fastMalloc` .
|
||||
If NULL pointer is passed, the function does nothing.
|
||||
|
||||
.. index:: format
|
||||
|
||||
format
|
||||
----------
|
||||
.. cpp:function:: string format( const char* fmt, ... )
|
||||
.. ocv:function:: string format( const char* fmt, ... )
|
||||
|
||||
Returns a text string formatted using the ``printf`` -like expression.
|
||||
|
||||
:param fmt: ``printf`` -compatible formatting specifiers.
|
||||
|
||||
The function acts like ``sprintf`` but forms and returns an STL string. It can be used to form an error message in the
|
||||
:cpp:func:`Exception` constructor.
|
||||
:ocv:func:`Exception` constructor.
|
||||
|
||||
.. index:: getNumThreads
|
||||
|
||||
getNumThreads
|
||||
-----------------
|
||||
.. cpp:function:: int getNumThreads()
|
||||
.. ocv:function:: int getNumThreads()
|
||||
|
||||
Returns the number of threads used by OpenCV.
|
||||
|
||||
The function returns the number of threads that is used by OpenCV.
|
||||
|
||||
See Also:
|
||||
:cpp:func:`setNumThreads`,
|
||||
:cpp:func:`getThreadNum`
|
||||
:ocv:func:`setNumThreads`,
|
||||
:ocv:func:`getThreadNum`
|
||||
|
||||
.. index:: getThreadNum
|
||||
|
||||
getThreadNum
|
||||
----------------
|
||||
.. cpp:function:: int getThreadNum()
|
||||
.. ocv:function:: int getThreadNum()
|
||||
|
||||
Returns the index of the currently executed thread.
|
||||
|
||||
The function returns a 0-based index of the currently executed thread. The function is only valid inside a parallel OpenMP region. When OpenCV is built without OpenMP support, the function always returns 0.
|
||||
|
||||
See Also:
|
||||
:cpp:func:`setNumThreads`,
|
||||
:cpp:func:`getNumThreads` .
|
||||
:ocv:func:`setNumThreads`,
|
||||
:ocv:func:`getNumThreads` .
|
||||
|
||||
.. index:: getTickCount
|
||||
|
||||
getTickCount
|
||||
----------------
|
||||
.. cpp:function:: int64 getTickCount()
|
||||
.. ocv:function:: int64 getTickCount()
|
||||
|
||||
Returns the number of ticks.
|
||||
|
||||
The function returns the number of ticks after the certain event (for example, when the machine was turned on).
|
||||
It can be used to initialize
|
||||
:cpp:func:`RNG` or to measure a function execution time by reading the tick count before and after the function call. See also the tick frequency.
|
||||
:ocv:func:`RNG` or to measure a function execution time by reading the tick count before and after the function call. See also the tick frequency.
|
||||
|
||||
.. index:: getTickFrequency
|
||||
|
||||
getTickFrequency
|
||||
--------------------
|
||||
.. cpp:function:: double getTickFrequency()
|
||||
.. ocv:function:: double getTickFrequency()
|
||||
|
||||
Returns the number of ticks per second.
|
||||
|
||||
@@ -248,7 +248,7 @@ That is, the following code computes the execution time in seconds: ::
|
||||
|
||||
getCPUTickCount
|
||||
----------------
|
||||
.. cpp:function:: int64 getCPUTickCount()
|
||||
.. ocv:function:: int64 getCPUTickCount()
|
||||
|
||||
Returns the number of CPU ticks.
|
||||
|
||||
@@ -258,7 +258,7 @@ The function returns the current number of CPU ticks on some architectures (such
|
||||
|
||||
setNumThreads
|
||||
-----------------
|
||||
.. cpp:function:: void setNumThreads(int nthreads)
|
||||
.. ocv:function:: void setNumThreads(int nthreads)
|
||||
|
||||
Sets the number of threads used by OpenCV.
|
||||
|
||||
@@ -267,14 +267,14 @@ setNumThreads
|
||||
The function sets the number of threads used by OpenCV in parallel OpenMP regions. If ``nthreads=0`` , the function uses the default number of threads that is usually equal to the number of the processing cores.
|
||||
|
||||
See Also:
|
||||
:cpp:func:`getNumThreads`,
|
||||
:cpp:func:`getThreadNum`
|
||||
:ocv:func:`getNumThreads`,
|
||||
:ocv:func:`getThreadNum`
|
||||
|
||||
.. index:: setUseOptimized
|
||||
|
||||
setUseOptimized
|
||||
-----------------
|
||||
.. cpp:function:: void setUseOptimized(bool onoff)
|
||||
.. ocv:function:: void setUseOptimized(bool onoff)
|
||||
|
||||
Enables or disables the optimized code.
|
||||
|
||||
@@ -288,7 +288,7 @@ By default, the optimized code is enabled (unless you disable it in CMake). The
|
||||
|
||||
useOptimized
|
||||
-----------------
|
||||
.. cpp:function:: bool useOptimized()
|
||||
.. ocv:function:: bool useOptimized()
|
||||
|
||||
Returns status of the optimized code use
|
||||
|
||||
|
Reference in New Issue
Block a user