CLAHE Python bindings
[profile/ivi/opencv.git] / modules / ocl / doc / object_detection.rst
1 Object Detection
2 =============================
3
4 .. highlight:: cpp
5
6 ocl::OclCascadeClassifier
7 -------------------------
8 .. ocv:class:: ocl::OclCascadeClassifier : public CascadeClassifier
9
10 Cascade classifier class used for object detection. Supports HAAR cascade classifier  in the form of cross link ::
11
12     class CV_EXPORTS OclCascadeClassifier : public CascadeClassifier
13     {
14     public:
15           OclCascadeClassifier() {};
16           ~OclCascadeClassifier() {};
17            CvSeq *oclHaarDetectObjects(oclMat &gimg, CvMemStorage *storage,
18                                       double scaleFactor,int minNeighbors,
19                                       int flags, CvSize minSize = cvSize(0, 0),
20                                       CvSize maxSize = cvSize(0, 0));
21     };
22
23 ocl::OclCascadeClassifier::oclHaarDetectObjects
24 ------------------------------------------------------
25 Returns the detected objects by a list of rectangles
26
27 .. ocv:function:: CvSeq* ocl::OclCascadeClassifier::oclHaarDetectObjects(oclMat &gimg, CvMemStorage *storage, double scaleFactor,int minNeighbors, int flags, CvSize minSize = cvSize(0, 0), CvSize maxSize = cvSize(0, 0))
28
29     :param image:  Matrix of type CV_8U containing an image where objects should be detected.
30
31     :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).
32
33     :param scaleFactor: Parameter specifying how much the image size is reduced at each image scale.
34
35     :param minNeighbors: Parameter specifying how many neighbors each candidate rectangle should have to retain it.
36
37     :param minSize: Minimum possible object size. Objects smaller than that are ignored.
38
39 Detects objects of different sizes in the input image,only tested for face detection now. The function returns the number of detected objects.
40
41 ocl::MatchTemplateBuf
42 ---------------------
43 .. ocv:struct:: ocl::MatchTemplateBuf
44
45 Class providing memory buffers for :ocv:func:`ocl::matchTemplate` function, plus it allows to adjust some specific parameters. ::
46
47     struct CV_EXPORTS MatchTemplateBuf
48     {
49         Size user_block_size;
50         oclMat imagef, templf;
51         std::vector<oclMat> images;
52         std::vector<oclMat> image_sums;
53         std::vector<oclMat> image_sqsums;
54     };
55
56 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.
57
58 ocl::matchTemplate
59 ------------------
60 Computes a proximity map for a raster template and an image where the template is searched for.
61
62 .. ocv:function:: void ocl::matchTemplate(const oclMat& image, const oclMat& templ, oclMat& result, int method)
63
64 .. ocv:function:: void ocl::matchTemplate(const oclMat& image, const oclMat& templ, oclMat& result, int method, MatchTemplateBuf &buf)
65
66     :param image: Source image.  ``CV_32F`` and  ``CV_8U`` depth images (1..4 channels) are supported for now.
67
68     :param templ: Template image with the size and type the same as  ``image`` .
69
70     :param result: Map containing comparison results ( ``CV_32FC1`` ). If  ``image`` is  *W x H*  and ``templ`` is  *w x h*, then  ``result`` must be *W-w+1 x H-h+1*.
71
72     :param method: Specifies the way to compare the template with the image.
73
74     :param buf: Optional buffer to avoid extra memory allocations and to adjust some specific parameters. See :ocv:struct:`ocl::MatchTemplateBuf`.
75
76     The following methods are supported for the ``CV_8U`` depth images for now:
77
78     * ``CV_TM_SQDIFF``
79     * ``CV_TM_SQDIFF_NORMED``
80     * ``CV_TM_CCORR``
81     * ``CV_TM_CCORR_NORMED``
82     * ``CV_TM_CCOEFF``
83     * ``CV_TM_CCOEFF_NORMED``
84
85     The following methods are supported for the ``CV_32F`` images for now:
86
87     * ``CV_TM_SQDIFF``
88     * ``CV_TM_CCORR``
89
90 .. seealso:: :ocv:func:`matchTemplate`