@@ -37,7 +37,7 @@ Finds edges in an image using the [Canny86]_ algorithm.
ocl::BruteForceMatcher_OCL_base
-------------------------------
-----------------------------------
.. ocv:class:: ocl::BruteForceMatcher_OCL_base
Brute-force descriptor matcher. For each descriptor in the first set, this matcher finds the closest descriptor in the second set by trying each one. This descriptor matcher supports masking permissible matches between descriptor sets. ::
...
...
@@ -153,7 +153,7 @@ The class ``BruteForceMatcher_OCL_base`` has an interface similar to the class :
ocl::BruteForceMatcher_OCL_base::match
--------------------------------------
------------------------------------------
Finds the best match for each descriptor from a query set with train descriptors.
Performs a GPU collection of train descriptors and masks in a suitable format for the :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchCollection` function.
Downloads matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchSingle` or :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchCollection` to vector with :ocv:class:`DMatch`.
@@ -185,7 +185,7 @@ Downloads matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::matc
ocl::BruteForceMatcher_OCL_base::matchConvert
---------------------------------------------
-------------------------------------------------
Converts matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchSingle` or :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchCollection` to vector with :ocv:class:`DMatch`.
Downloads matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::knnMatchSingle` or :ocv:func:`ocl::BruteForceMatcher_OCL_base::knnMatch2Collection` to vector with :ocv:class:`DMatch`.
Converts matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::knnMatchSingle` or :ocv:func:`ocl::BruteForceMatcher_OCL_base::knnMatch2Collection` to CPU vector with :ocv:class:`DMatch`.
Downloads matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::radiusMatchSingle` or :ocv:func:`ocl::BruteForceMatcher_OCL_base::radiusMatchCollection` to vector with :ocv:class:`DMatch`.
Converts matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::radiusMatchSingle` or :ocv:func:`ocl::BruteForceMatcher_OCL_base::radiusMatchCollection` to vector with :ocv:class:`DMatch`.
:param prevImg: First 8-bit input image (supports both grayscale and color images).
:param nextImg: Second input image of the same size and the same type as ``prevImg`` .
:param prevPts: Vector of 2D points for which the flow needs to be found. It must be one row matrix with CV_32FC2 type.
:param nextPts: Output vector of 2D points (with single-precision floating-point coordinates) containing the calculated new positions of input features in the second image. When ``useInitialFlow`` is true, the vector must have the same size as in the input.
:param status: Output status vector (CV_8UC1 type). Each element of the vector is set to 1 if the flow for the corresponding features has been found. Otherwise, it is set to 0.
:param err: Output vector (CV_32FC1 type) that contains the difference between patches around the original and moved points or min eigen value if ``getMinEigenVals`` is checked. It can be NULL, if not needed.
:param prevImg: First 8-bit grayscale input image.
:param nextImg: Second input image of the same size and the same type as ``prevImg`` .
:param u: Horizontal component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
:param v: Vertical component of the optical flow of the same size as input images, 32-bit floating-point, single-channel
:param err: Output vector (CV_32FC1 type) that contains the difference between patches around the original and moved points or min eigen value if ``getMinEigenVals`` is checked. It can be NULL, if not needed.
:param isRegression: Type of the problem: ``true`` for regression and ``false`` for classification.
:param maxK: Number of maximum neighbors that may be passed to the method :ocv:func:`CvKNearest::find_nearest`.
:param updateBase: Specifies whether the model is trained from scratch (``update_base=false``), or it is updated using the new training data (``update_base=true``). In the latter case, the parameter ``maxK`` must not be larger than the original value.
The method trains the K-Nearest model. It follows the conventions of the generic :ocv:func:`CvStatModel::train` approach with the following limitations:
* Only ``CV_ROW_SAMPLE`` data layout is supported.
* Input variables are all ordered.
* Output variables can be either categorical ( ``is_regression=false`` ) or ordered ( ``is_regression=true`` ).
* Variable subsets (``var_idx``) and missing measurements are not supported.
ocl::KNearestNeighbour::find_nearest
----------------------------------------
Finds the neighbors and predicts responses for input vectors.
:param samples: Input samples stored by rows. It is a single-precision floating-point matrix of :math:`number\_of\_samples \times number\_of\_features` size.
:param k: Number of used nearest neighbors. It must satisfy constraint: :math:`k \le` :ocv:func:`CvKNearest::get_max_k`.
:param labels: Vector with results of prediction (regression or classification) for each input sample. It is a single-precision floating-point vector with ``number_of_samples`` elements.
ocl::kmeans
---------------
Finds centers of clusters and groups input samples around the clusters.
.. ocv:function:: double ocl::kmeans(const oclMat &src, int K, oclMat &bestLabels, TermCriteria criteria, int attemps, int flags, oclMat ¢ers)
:param src: Floating-point matrix of input samples, one row per sample.
:param K: Number of clusters to split the set by.
:param bestLabels: Input/output integer array that stores the cluster indices for every sample.
:param criteria: The algorithm termination criteria, that is, the maximum number of iterations and/or the desired accuracy. The accuracy is specified as ``criteria.epsilon``. As soon as each of the cluster centers moves by less than ``criteria.epsilon`` on some iteration, the algorithm stops.
:param attempts: Flag to specify the number of times the algorithm is executed using different initial labellings. The algorithm returns the labels that yield the best compactness (see the last function parameter).
:param flags: Flag that can take the following values:
* **KMEANS_RANDOM_CENTERS** Select random initial centers in each attempt.
* **KMEANS_PP_CENTERS** Use ``kmeans++`` center initialization by Arthur and Vassilvitskii [Arthur2007].
* **KMEANS_USE_INITIAL_LABELS** During the first (and possibly the only) attempt, use the user-supplied labels instead of computing them from the initial centers. For the second and further attempts, use the random or semi-random centers. Use one of ``KMEANS_*_CENTERS`` flag to specify the exact method.
:param centers: Output matrix of the cluster centers, one row per each cluster center.
:param imageobjectsBuff: Buffer to store detected objects (rectangles). If it is empty, it is allocated with the defaultsize. If not empty, the function searches not more than N objects, where N = sizeof(objectsBufers data)/sizeof(cv::Rect).
:param gimage: Matrix of type CV_8U containing an image where objects should be detected.
:param scaleFactor: Parameter specifying how much the image size is reduced at each image scale.
:param minNeighbors: Parameter specifying how many neighbors each candidate rectangle should have to retain it.
:param flags: Parameter with the same meaning for an old cascade as in the function ``cvHaarDetectObjects``. It is not used for a new cascade.
:param minSize: Minimum possible object size. Objects smaller than that are ignored.
Detects objects of different sizes in the input image,only tested for face detection now. The function returns the number of detected objects.
:param maxSize: Maximum possible object size. Objects larger than that are ignored.
The function provides a very similar interface with that in CascadeClassifier class, except using oclMat as input image.
ocl::MatchTemplateBuf
---------------------
-------------------------
.. ocv:struct:: ocl::MatchTemplateBuf
Class providing memory buffers for :ocv:func:`ocl::matchTemplate` function, plus it allows to adjust some specific parameters. ::
...
...
@@ -60,7 +61,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.
The method converts source pixel values to the target datatype. saturate cast is applied in the end to avoid possible overflows. Supports CV_8UC1, CV_8UC4, CV_32SC1, CV_32SC4, CV_32FC1, CV_32FC4.
where ``I`` is a multi-dimensional index of array elements. In case of multi-channel arrays, each channel is processed independently.
.. seealso:: :ocv:func:`addWeighted`
ocl::subtract
------------------
Returns void
...
...
@@ -319,6 +347,22 @@ Returns void
The function magnitude calculates magnitude of 2D vectors formed from the corresponding elements of x and y arrays. Supports only CV_32F and CV_64F data type.
ocl::magnitudeSqr
---------------------
Computes squared magnitudes of complex matrix elements.
:param x: The floating-point array of x-coordinates of the vectors
:param y: he floating-point array of y-coordinates of the vectors; must have the same size as x
:param magnitude: The destination array; will have the same size and same type as x
The function magnitude calculates magnitude of 2D vectors formed from the corresponding elements of x and y arrays. Supports only CV_32F and CV_64F data type.
@@ -4,7 +4,7 @@ Data Structures and Utility Functions
.. highlight:: cpp
ocl::Info
---------
-------------
.. ocv:class:: ocl::Info
this class should be maintained by the user and be passed to getDevice
...
...
@@ -42,7 +42,7 @@ Returns void
If you call this function and set a valid path, the OCL module will save the compiled kernel to the address in the first time and reload the binary since that. It can save compilation time at the runtime.