update gpu docs

This commit is contained in:
Vladislav Vinogradov
2011-08-30 08:27:23 +00:00
parent 50d012b56b
commit 837f65784e
10 changed files with 1263 additions and 982 deletions

View File

@@ -3,14 +3,13 @@ Object Detection
.. highlight:: cpp
.. index:: gpu::HOGDescriptor
gpu::HOGDescriptor
------------------
.. ocv:class:: gpu::HOGDescriptor
The class implements Histogram of Oriented Gradients ([Dalal2005]_) object detector.
::
The class implements Histogram of Oriented Gradients ([Dalal2005]_) object detector. ::
struct CV_EXPORTS HOGDescriptor
{
@@ -63,13 +62,13 @@ The class implements Histogram of Oriented Gradients ([Dalal2005]_) object detec
Interfaces of all methods are kept similar to the ``CPU HOG`` descriptor and detector analogues as much as possible.
.. index:: gpu::HOGDescriptor::HOGDescriptor
gpu::HOGDescriptor::HOGDescriptor
-------------------------------------
.. ocv:function:: gpu::HOGDescriptor::HOGDescriptor(Size win_size=Size(64, 128), Size block_size=Size(16, 16), Size block_stride=Size(8, 8), Size cell_size=Size(8, 8), int nbins=9, double win_sigma=DEFAULT_WIN_SIGMA, double threshold_L2hys=0.2, bool gamma_correction=true, int nlevels=DEFAULT_NLEVELS)
Creates the ``HOG`` descriptor and detector.
Creates the ``HOG`` descriptor and detector.
.. ocv:function:: gpu::HOGDescriptor::HOGDescriptor(Size win_size=Size(64, 128), Size block_size=Size(16, 16), Size block_stride=Size(8, 8), Size cell_size=Size(8, 8), int nbins=9, double win_sigma=DEFAULT_WIN_SIGMA, double threshold_L2hys=0.2, bool gamma_correction=true, int nlevels=DEFAULT_NLEVELS)
:param win_size: Detection window size. Align to block size and block stride.
@@ -89,61 +88,61 @@ gpu::HOGDescriptor::HOGDescriptor
:param nlevels: Maximum number of detection window increases.
.. index:: gpu::HOGDescriptor::getDescriptorSize
gpu::HOGDescriptor::getDescriptorSize
-----------------------------------------
Returns the number of coefficients required for the classification.
.. ocv:function:: size_t gpu::HOGDescriptor::getDescriptorSize() const
Returns the number of coefficients required for the classification.
.. index:: gpu::HOGDescriptor::getBlockHistogramSize
gpu::HOGDescriptor::getBlockHistogramSize
---------------------------------------------
Returns the block histogram size.
.. ocv:function:: size_t gpu::HOGDescriptor::getBlockHistogramSize() const
Returns the block histogram size.
.. index:: gpu::HOGDescriptor::setSVMDetector
gpu::HOGDescriptor::setSVMDetector
--------------------------------------
Sets coefficients for the linear SVM classifier.
.. ocv:function:: void gpu::HOGDescriptor::setSVMDetector(const vector<float>& detector)
Sets coefficients for the linear SVM classifier.
.. index:: gpu::HOGDescriptor::getDefaultPeopleDetector
gpu::HOGDescriptor::getDefaultPeopleDetector
------------------------------------------------
Returns coefficients of the classifier trained for people detection (for default window size).
.. ocv:function:: static vector<float> gpu::HOGDescriptor::getDefaultPeopleDetector()
Returns coefficients of the classifier trained for people detection (for default window size).
.. index:: gpu::HOGDescriptor::getPeopleDetector48x96
gpu::HOGDescriptor::getPeopleDetector48x96
----------------------------------------------
Returns coefficients of the classifier trained for people detection (for 48x96 windows).
.. ocv:function:: static vector<float> gpu::HOGDescriptor::getPeopleDetector48x96()
Returns coefficients of the classifier trained for people detection (for 48x96 windows).
.. index:: gpu::HOGDescriptor::getPeopleDetector64x128
gpu::HOGDescriptor::getPeopleDetector64x128
-----------------------------------------------
Returns coefficients of the classifier trained for people detection (for 64x128 windows).
.. ocv:function:: static vector<float> gpu::HOGDescriptor::getPeopleDetector64x128()
Returns coefficients of the classifier trained for people detection (for 64x128 windows).
.. index:: gpu::HOGDescriptor::detect
gpu::HOGDescriptor::detect
------------------------------
.. ocv:function:: void gpu::HOGDescriptor::detect(const GpuMat& img, vector<Point>& found_locations, double hit_threshold=0, Size win_stride=Size(), Size padding=Size())
Performs object detection without a multi-scale window.
Performs object detection without a multi-scale window.
.. ocv:function:: void gpu::HOGDescriptor::detect(const GpuMat& img, vector<Point>& found_locations, double hit_threshold=0, Size win_stride=Size(), Size padding=Size())
:param img: Source image. ``CV_8UC1`` and ``CV_8UC4`` types are supported for now.
@@ -155,13 +154,13 @@ gpu::HOGDescriptor::detect
:param padding: Mock parameter to keep the CPU interface compatibility. It must be (0,0).
.. index:: gpu::HOGDescriptor::detectMultiScale
gpu::HOGDescriptor::detectMultiScale
----------------------------------------
.. ocv:function:: void gpu::HOGDescriptor::detectMultiScale(const GpuMat& img, vector<Rect>& found_locations, double hit_threshold=0, Size win_stride=Size(), Size padding=Size(), double scale0=1.05, int group_threshold=2)
Performs object detection with a multi-scale window.
Performs object detection with a multi-scale window.
.. ocv:function:: void gpu::HOGDescriptor::detectMultiScale(const GpuMat& img, vector<Rect>& found_locations, double hit_threshold=0, Size win_stride=Size(), Size padding=Size(), double scale0=1.05, int group_threshold=2)
:param img: Source image. See :ocv:func:`gpu::HOGDescriptor::detect` for type limitations.
@@ -177,13 +176,13 @@ gpu::HOGDescriptor::detectMultiScale
:param group_threshold: Coefficient to regulate the similarity threshold. When detected, some objects can be covered by many rectangles. 0 means not to perform grouping. See :ocv:func:`groupRectangles` .
.. index:: gpu::HOGDescriptor::getDescriptors
gpu::HOGDescriptor::getDescriptors
--------------------------------------
.. ocv:function:: void gpu::HOGDescriptor::getDescriptors(const GpuMat& img, Size win_stride, GpuMat& descriptors, int descr_format=DESCR_FORMAT_COL_BY_COL)
Returns block descriptors computed for the whole image.
Returns block descriptors computed for the whole image. The function is mainly used to learn the classifier.
.. ocv:function:: void gpu::HOGDescriptor::getDescriptors(const GpuMat& img, Size win_stride, GpuMat& descriptors, int descr_format=DESCR_FORMAT_COL_BY_COL)
:param img: Source image. See :ocv:func:`gpu::HOGDescriptor::detect` for type limitations.
@@ -191,21 +190,21 @@ gpu::HOGDescriptor::getDescriptors
:param descriptors: 2D array of descriptors.
:param descr_format: Descriptor storage format:
:param descr_format: Descriptor storage format:
* **DESCR_FORMAT_ROW_BY_ROW** - Row-major order.
* **DESCR_FORMAT_COL_BY_COL** - Column-major order.
.. index:: gpu::CascadeClassifier_GPU
The function is mainly used to learn the classifier.
gpu::CascadeClassifier_GPU
--------------------------
.. ocv:class:: gpu::CascadeClassifier_GPU
Cascade classifier class used for object detection.
::
Cascade classifier class used for object detection. ::
class CV_EXPORTS CascadeClassifier_GPU
{
@@ -231,53 +230,48 @@ Cascade classifier class used for object detection.
};
.. index:: gpu::CascadeClassifier_GPU::CascadeClassifier_GPU
gpu::CascadeClassifier_GPU::CascadeClassifier_GPU
-----------------------------------------------------
.. ocv:function:: gpu::CascadeClassifier_GPU(const string& filename)
Loads the classifier from a file.
Loads the classifier from a file.
.. ocv:function:: gpu::CascadeClassifier_GPU(const string& filename)
:param filename: Name of the file from which the classifier is loaded. Only the old ``haar`` classifier (trained by the ``haar`` training application) and NVIDIA's ``nvbin`` are supported.
.. index:: gpu::CascadeClassifier_GPU::empty
.. _gpu::CascadeClassifier_GPU::empty:
gpu::CascadeClassifier_GPU::empty
-------------------------------------
Checks whether the classifier is loaded or not.
.. ocv:function:: bool gpu::CascadeClassifier_GPU::empty() const
Checks whether the classifier is loaded or not.
.. index:: gpu::CascadeClassifier_GPU::load
.. _gpu::CascadeClassifier_GPU::load:
gpu::CascadeClassifier_GPU::load
------------------------------------
.. ocv:function:: bool gpu::CascadeClassifier_GPU::load(const string& filename)
Loads the classifier from a file. The previous content is destroyed.
Loads the classifier from a file. The previous content is destroyed.
.. ocv:function:: bool gpu::CascadeClassifier_GPU::load(const string& filename)
:param filename: Name of the file from which the classifier is loaded. Only the old ``haar`` classifier (trained by the ``haar`` training application) and NVIDIA's ``nvbin`` are supported.
.. index:: gpu::CascadeClassifier_GPU::release
gpu::CascadeClassifier_GPU::release
---------------------------------------
Destroys the loaded classifier.
.. ocv:function:: void gpu::CascadeClassifier_GPU::release()
Destroys the loaded classifier.
.. index:: gpu::CascadeClassifier_GPU::detectMultiScale
gpu::CascadeClassifier_GPU::detectMultiScale
------------------------------------------------
.. ocv:function:: int gpu::CascadeClassifier_GPU::detectMultiScale(const GpuMat& image, GpuMat& objectsBuf, double scaleFactor=1.2, int minNeighbors=4, Size minSize=Size())
Detects objects of different sizes in the input image.
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
.. ocv:function:: int gpu::CascadeClassifier_GPU::detectMultiScale(const GpuMat& image, GpuMat& objectsBuf, double scaleFactor=1.2, int minNeighbors=4, Size minSize=Size())
:param image: Matrix of type ``CV_8U`` containing an image where objects should be detected.
@@ -289,9 +283,9 @@ gpu::CascadeClassifier_GPU::detectMultiScale
:param minSize: Minimum possible object size. Objects smaller than that are ignored.
The function returns the number of detected objects, so you can retrieve them as in the following example:
The detected objects are returned as a list of rectangles.
::
The function returns the number of detected objects, so you can retrieve them as in the following example: ::
gpu::CascadeClassifier_GPU cascade_gpu(...);
@@ -313,6 +307,8 @@ gpu::CascadeClassifier_GPU::detectMultiScale
imshow("Faces", image_cpu);
.. seealso:: :ocv:func:`CascadeClassifier::detectMultiScale`
.. seealso:: :ocv:func:`CascadeClassifier::detectMultiScale`
.. [Dalal2005] Navneet Dalal and Bill Triggs. *Histogram of oriented gradients for human detection*. 2005.