Merge pull request #1263 from abidrahmank:pyCLAHE_24
[profile/ivi/opencv.git] / modules / ocl / doc / feature_detection_and_description.rst
1 Feature Detection And Description
2 =================================
3
4 .. highlight:: cpp
5
6 ocl::Canny
7 -------------------
8 Finds edges in an image using the [Canny86]_ algorithm.
9
10 .. ocv:function:: void ocl::Canny(const oclMat& image, oclMat& edges, double low_thresh, double high_thresh, int apperture_size = 3, bool L2gradient = false)
11
12 .. ocv:function:: void ocl::Canny(const oclMat& image, CannyBuf& buf, oclMat& edges, double low_thresh, double high_thresh, int apperture_size = 3, bool L2gradient = false)
13
14 .. ocv:function:: void ocl::Canny(const oclMat& dx, const oclMat& dy, oclMat& edges, double low_thresh, double high_thresh, bool L2gradient = false)
15
16 .. ocv:function:: void ocl::Canny(const oclMat& dx, const oclMat& dy, CannyBuf& buf, oclMat& edges, double low_thresh, double high_thresh, bool L2gradient = false)
17
18     :param image: Single-channel 8-bit input image.
19
20     :param dx: First derivative of image in the vertical direction. Support only ``CV_32S`` type.
21
22     :param dy: First derivative of image in the horizontal direction. Support only ``CV_32S`` type.
23
24     :param edges: Output edge map. It has the same size and type as  ``image`` .
25
26     :param low_thresh: First threshold for the hysteresis procedure.
27
28     :param high_thresh: Second threshold for the hysteresis procedure.
29
30     :param apperture_size: Aperture size for the  :ocv:func:`Sobel`  operator.
31
32     :param L2gradient: Flag indicating whether a more accurate  :math:`L_2`  norm  :math:`=\sqrt{(dI/dx)^2 + (dI/dy)^2}`  should be used to compute the image gradient magnitude ( ``L2gradient=true`` ), or a faster default  :math:`L_1`  norm  :math:`=|dI/dx|+|dI/dy|`  is enough ( ``L2gradient=false`` ).
33
34     :param buf: Optional buffer to avoid extra memory allocations (for many calls with the same sizes).
35
36 .. seealso:: :ocv:func:`Canny`
37
38
39 ocl::BruteForceMatcher_OCL_base
40 -------------------------------
41 .. ocv:class:: ocl::BruteForceMatcher_OCL_base
42
43 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. ::
44
45     class BruteForceMatcher_OCL_base
46     {
47     public:
48             enum DistType {L1Dist = 0, L2Dist, HammingDist};
49
50         // Add descriptors to train descriptor collection.
51         void add(const std::vector<oclMat>& descCollection);
52
53         // Get train descriptors collection.
54         const std::vector<oclMat>& getTrainDescriptors() const;
55
56         // Clear train descriptors collection.
57         void clear();
58
59         // Return true if there are no train descriptors in collection.
60         bool empty() const;
61
62         // Return true if the matcher supports mask in match methods.
63         bool isMaskSupported() const;
64
65         void matchSingle(const oclMat& query, const oclMat& train,
66             oclMat& trainIdx, oclMat& distance,
67             const oclMat& mask = oclMat());
68
69         static void matchDownload(const oclMat& trainIdx,
70             const oclMat& distance, std::vector<DMatch>& matches);
71         static void matchConvert(const Mat& trainIdx,
72             const Mat& distance, std::vector<DMatch>& matches);
73
74         void match(const oclMat& query, const oclMat& train,
75             std::vector<DMatch>& matches, const oclMat& mask = oclMat());
76
77         void makeGpuCollection(oclMat& trainCollection, oclMat& maskCollection,
78             const vector<oclMat>& masks = std::vector<oclMat>());
79
80         void matchCollection(const oclMat& query, const oclMat& trainCollection,
81             oclMat& trainIdx, oclMat& imgIdx, oclMat& distance,
82             const oclMat& maskCollection);
83
84         static void matchDownload(const oclMat& trainIdx, oclMat& imgIdx,
85             const oclMat& distance, std::vector<DMatch>& matches);
86         static void matchConvert(const Mat& trainIdx, const Mat& imgIdx,
87             const Mat& distance, std::vector<DMatch>& matches);
88
89         void match(const oclMat& query, std::vector<DMatch>& matches,
90             const std::vector<oclMat>& masks = std::vector<oclMat>());
91
92         void knnMatchSingle(const oclMat& query, const oclMat& train,
93             oclMat& trainIdx, oclMat& distance, oclMat& allDist, int k,
94             const oclMat& mask = oclMat());
95
96         static void knnMatchDownload(const oclMat& trainIdx, const oclMat& distance,
97             std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
98         static void knnMatchConvert(const Mat& trainIdx, const Mat& distance,
99             std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
100
101         void knnMatch(const oclMat& query, const oclMat& train,
102             std::vector< std::vector<DMatch> >& matches, int k,
103             const oclMat& mask = oclMat(), bool compactResult = false);
104
105         void knnMatch2Collection(const oclMat& query, const oclMat& trainCollection,
106             oclMat& trainIdx, oclMat& imgIdx, oclMat& distance,
107             const oclMat& maskCollection = oclMat());
108
109         static void knnMatch2Download(const oclMat& trainIdx, const oclMat& imgIdx, const oclMat& distance,
110             std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
111         static void knnMatch2Convert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance,
112             std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
113
114         void knnMatch(const oclMat& query, std::vector< std::vector<DMatch> >& matches, int k,
115             const std::vector<oclMat>& masks = std::vector<oclMat>(),
116             bool compactResult = false);
117
118         void radiusMatchSingle(const oclMat& query, const oclMat& train,
119             oclMat& trainIdx, oclMat& distance, oclMat& nMatches, float maxDistance,
120             const oclMat& mask = oclMat());
121
122         static void radiusMatchDownload(const oclMat& trainIdx, const oclMat& distance, const oclMat& nMatches,
123             std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
124         static void radiusMatchConvert(const Mat& trainIdx, const Mat& distance, const Mat& nMatches,
125             std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
126
127         void radiusMatch(const oclMat& query, const oclMat& train,
128             std::vector< std::vector<DMatch> >& matches, float maxDistance,
129             const oclMat& mask = oclMat(), bool compactResult = false);
130
131         void radiusMatchCollection(const oclMat& query, oclMat& trainIdx, oclMat& imgIdx, oclMat& distance, oclMat& nMatches, float maxDistance,
132             const std::vector<oclMat>& masks = std::vector<oclMat>());
133
134         static void radiusMatchDownload(const oclMat& trainIdx, const oclMat& imgIdx, const oclMat& distance, const oclMat& nMatches,
135             std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
136         static void radiusMatchConvert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance, const Mat& nMatches,
137             std::vector< std::vector<DMatch> >& matches, bool compactResult = false);
138
139         void radiusMatch(const oclMat& query, std::vector< std::vector<DMatch> >& matches, float maxDistance,
140             const std::vector<oclMat>& masks = std::vector<oclMat>(), bool compactResult = false);
141
142                 DistType distType;
143
144     private:
145         std::vector<oclMat> trainDescCollection;
146     };
147
148
149 The class ``BruteForceMatcher_OCL_base`` has an interface similar to the class :ocv:class:`DescriptorMatcher`. It has two groups of ``match`` methods: for matching descriptors of one image with another image or with an image set. Also, all functions have an alternative to save results either to the GPU memory or to the CPU memory. ``BruteForceMatcher_OCL_base`` supports only the ``L1<float>``, ``L2<float>``, and ``Hamming`` distance types.
150
151 .. seealso:: :ocv:class:`DescriptorMatcher`, :ocv:class:`BFMatcher`
152
153
154
155 ocl::BruteForceMatcher_OCL_base::match
156 --------------------------------------
157 Finds the best match for each descriptor from a query set with train descriptors.
158
159 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::match(const oclMat& query, const oclMat& train, std::vector<DMatch>& matches, const oclMat& mask = oclMat())
160
161 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::matchSingle(const oclMat& query, const oclMat& train, oclMat& trainIdx, oclMat& distance, const oclMat& mask = oclMat())
162
163 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::match(const oclMat& query, std::vector<DMatch>& matches, const std::vector<oclMat>& masks = std::vector<oclMat>())
164
165 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::matchCollection( const oclMat& query, const oclMat& trainCollection, oclMat& trainIdx, oclMat& imgIdx, oclMat& distance, const oclMat& masks=oclMat() )
166
167 .. seealso:: :ocv:func:`DescriptorMatcher::match`
168
169
170
171 ocl::BruteForceMatcher_OCL_base::makeGpuCollection
172 --------------------------------------------------
173 Performs a GPU collection of train descriptors and masks in a suitable format for the :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchCollection` function.
174
175 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::makeGpuCollection(oclMat& trainCollection, oclMat& maskCollection, const vector<oclMat>& masks = std::vector<oclMat>())
176
177
178 ocl::BruteForceMatcher_OCL_base::matchDownload
179 ----------------------------------------------
180 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`.
181
182 .. ocv:function:: static void ocl::BruteForceMatcher_OCL_base::matchDownload( const oclMat& trainIdx, const oclMat& distance, std::vector<DMatch>& matches )
183
184 .. ocv:function:: static void ocl::BruteForceMatcher_OCL_base::matchDownload( const oclMat& trainIdx, const oclMat& imgIdx, const oclMat& distance, std::vector<DMatch>& matches )
185
186
187 ocl::BruteForceMatcher_OCL_base::matchConvert
188 ---------------------------------------------
189 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`.
190
191 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::matchConvert(const Mat& trainIdx, const Mat& distance, std::vector<DMatch>&matches)
192
193 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::matchConvert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance, std::vector<DMatch>&matches)
194
195
196
197 ocl::BruteForceMatcher_OCL_base::knnMatch
198 -----------------------------------------
199 Finds the ``k`` best matches for each descriptor from a query set with train descriptors.
200
201 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatch(const oclMat& query, const oclMat& train, std::vector< std::vector<DMatch> >&matches, int k, const oclMat& mask = oclMat(), bool compactResult = false)
202
203 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatchSingle(const oclMat& query, const oclMat& train, oclMat& trainIdx, oclMat& distance, oclMat& allDist, int k, const oclMat& mask = oclMat())
204
205 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatch(const oclMat& query, std::vector< std::vector<DMatch> >&matches, int k, const std::vector<oclMat>&masks = std::vector<oclMat>(), bool compactResult = false )
206
207 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatch2Collection(const oclMat& query, const oclMat& trainCollection, oclMat& trainIdx, oclMat& imgIdx, oclMat& distance, const oclMat& maskCollection = oclMat())
208
209     :param query: Query set of descriptors.
210
211     :param train: Training set of descriptors. It is not be added to train descriptors collection stored in the class object.
212
213     :param k: Number of the best matches per each query descriptor (or less if it is not possible).
214
215     :param mask: Mask specifying permissible matches between the input query and train matrices of descriptors.
216
217     :param compactResult: If ``compactResult`` is ``true`` , the ``matches`` vector does not contain matches for fully masked-out query descriptors.
218
219
220 The function returns detected ``k`` (or less if not possible) matches in the increasing order by distance.
221
222 The third variant of the method stores the results in GPU memory.
223
224 .. seealso:: :ocv:func:`DescriptorMatcher::knnMatch`
225
226
227
228 ocl::BruteForceMatcher_OCL_base::knnMatchDownload
229 -------------------------------------------------
230 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`.
231
232 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatchDownload(const oclMat& trainIdx, const oclMat& distance, std::vector< std::vector<DMatch> >&matches, bool compactResult = false)
233
234 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatch2Download(const oclMat& trainIdx, const oclMat& imgIdx, const oclMat& distance, std::vector< std::vector<DMatch> >& matches, bool compactResult = false)
235
236 If ``compactResult`` is ``true`` , the ``matches`` vector does not contain matches for fully masked-out query descriptors.
237
238
239
240 ocl::BruteForceMatcher_OCL_base::knnMatchConvert
241 ------------------------------------------------
242 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`.
243
244 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatchConvert(const Mat& trainIdx, const Mat& distance, std::vector< std::vector<DMatch> >&matches, bool compactResult = false)
245
246 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::knnMatch2Convert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance, std::vector< std::vector<DMatch> >& matches, bool compactResult = false)
247
248 If ``compactResult`` is ``true`` , the ``matches`` vector does not contain matches for fully masked-out query descriptors.
249
250
251
252 ocl::BruteForceMatcher_OCL_base::radiusMatch
253 --------------------------------------------
254 For each query descriptor, finds the best matches with a distance less than a given threshold.
255
256 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatch(const oclMat& query, const oclMat& train, std::vector< std::vector<DMatch> >&matches, float maxDistance, const oclMat& mask = oclMat(), bool compactResult = false)
257
258 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatchSingle(const oclMat& query, const oclMat& train, oclMat& trainIdx, oclMat& distance, oclMat& nMatches, float maxDistance, const oclMat& mask = oclMat())
259
260 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatch(const oclMat& query, std::vector< std::vector<DMatch> >&matches, float maxDistance, const std::vector<oclMat>& masks = std::vector<oclMat>(), bool compactResult = false)
261
262 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatchCollection(const oclMat& query, oclMat& trainIdx, oclMat& imgIdx, oclMat& distance, oclMat& nMatches, float maxDistance, const std::vector<oclMat>& masks = std::vector<oclMat>())
263
264     :param query: Query set of descriptors.
265
266     :param train: Training set of descriptors. It is not added to train descriptors collection stored in the class object.
267
268     :param maxDistance: Distance threshold.
269
270     :param mask: Mask specifying permissible matches between the input query and train matrices of descriptors.
271
272     :param compactResult: If ``compactResult`` is ``true`` , the ``matches`` vector does not contain matches for fully masked-out query descriptors.
273
274
275 The function returns detected matches in the increasing order by distance.
276
277 The methods work only on devices with the compute capability  :math:`>=` 1.1.
278
279 The third variant of the method stores the results in GPU memory and does not store the points by the distance.
280
281 .. seealso:: :ocv:func:`DescriptorMatcher::radiusMatch`
282
283
284
285 ocl::BruteForceMatcher_OCL_base::radiusMatchDownload
286 ----------------------------------------------------
287 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`.
288
289 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatchDownload(const oclMat& trainIdx, const oclMat& distance, const oclMat& nMatches, std::vector< std::vector<DMatch> >&matches, bool compactResult = false)
290
291 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatchDownload(const oclMat& trainIdx, const oclMat& imgIdx, const oclMat& distance, const oclMat& nMatches, std::vector< std::vector<DMatch> >& matches, bool compactResult = false)
292
293 If ``compactResult`` is ``true`` , the ``matches`` vector does not contain matches for fully masked-out query descriptors.
294
295
296
297
298 ocl::BruteForceMatcher_OCL_base::radiusMatchConvert
299 ---------------------------------------------------
300 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`.
301
302 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatchConvert(const Mat& trainIdx, const Mat& distance, const Mat& nMatches, std::vector< std::vector<DMatch> >&matches, bool compactResult = false)
303
304 .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::radiusMatchConvert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance, const Mat& nMatches, std::vector< std::vector<DMatch> >& matches, bool compactResult = false)
305
306 If ``compactResult`` is ``true`` , the ``matches`` vector does not contain matches for fully masked-out query descriptors.
307
308 ocl::HOGDescriptor
309 ------------------
310
311 .. ocv:struct:: ocl::HOGDescriptor
312
313 The class implements Histogram of Oriented Gradients ([Dalal2005]_) object detector. ::
314
315     struct CV_EXPORTS HOGDescriptor
316     {
317         enum { DEFAULT_WIN_SIGMA = -1 };
318         enum { DEFAULT_NLEVELS = 64 };
319         enum { DESCR_FORMAT_ROW_BY_ROW, DESCR_FORMAT_COL_BY_COL };
320
321         HOGDescriptor(Size win_size=Size(64, 128), Size block_size=Size(16, 16),
322                       Size block_stride=Size(8, 8), Size cell_size=Size(8, 8),
323                       int nbins=9, double win_sigma=DEFAULT_WIN_SIGMA,
324                       double threshold_L2hys=0.2, bool gamma_correction=true,
325                       int nlevels=DEFAULT_NLEVELS);
326
327         size_t getDescriptorSize() const;
328         size_t getBlockHistogramSize() const;
329
330         void setSVMDetector(const vector<float>& detector);
331
332         static vector<float> getDefaultPeopleDetector();
333         static vector<float> getPeopleDetector48x96();
334         static vector<float> getPeopleDetector64x128();
335
336         void detect(const oclMat& img, vector<Point>& found_locations,
337                     double hit_threshold=0, Size win_stride=Size(),
338                     Size padding=Size());
339
340         void detectMultiScale(const oclMat& img, vector<Rect>& found_locations,
341                               double hit_threshold=0, Size win_stride=Size(),
342                               Size padding=Size(), double scale0=1.05,
343                               int group_threshold=2);
344
345         void getDescriptors(const oclMat& img, Size win_stride,
346                             oclMat& descriptors,
347                             int descr_format=DESCR_FORMAT_COL_BY_COL);
348
349         Size win_size;
350         Size block_size;
351         Size block_stride;
352         Size cell_size;
353         int nbins;
354         double win_sigma;
355         double threshold_L2hys;
356         bool gamma_correction;
357         int nlevels;
358
359     private:
360         // Hidden
361     }
362
363
364 Interfaces of all methods are kept similar to the ``CPU HOG`` descriptor and detector analogues as much as possible.
365
366 .. note::
367
368    (Ocl) An example using the HOG descriptor can be found at opencv_source_code/samples/ocl/hog.cpp
369
370 ocl::HOGDescriptor::HOGDescriptor
371 -------------------------------------
372 Creates the ``HOG`` descriptor and detector.
373
374 .. ocv:function:: ocl::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)
375
376    :param win_size: Detection window size. Align to block size and block stride.
377
378    :param block_size: Block size in pixels. Align to cell size. Only (16,16) is supported for now.
379
380    :param block_stride: Block stride. It must be a multiple of cell size.
381
382    :param cell_size: Cell size. Only (8, 8) is supported for now.
383
384    :param nbins: Number of bins. Only 9 bins per cell are supported for now.
385
386    :param win_sigma: Gaussian smoothing window parameter.
387
388    :param threshold_L2hys: L2-Hys normalization method shrinkage.
389
390    :param gamma_correction: Flag to specify whether the gamma correction preprocessing is required or not.
391
392    :param nlevels: Maximum number of detection window increases.
393
394
395
396 ocl::HOGDescriptor::getDescriptorSize
397 -----------------------------------------
398 Returns the number of coefficients required for the classification.
399
400 .. ocv:function:: size_t ocl::HOGDescriptor::getDescriptorSize() const
401
402
403
404 ocl::HOGDescriptor::getBlockHistogramSize
405 ---------------------------------------------
406 Returns the block histogram size.
407
408 .. ocv:function:: size_t ocl::HOGDescriptor::getBlockHistogramSize() const
409
410
411
412 ocl::HOGDescriptor::setSVMDetector
413 --------------------------------------
414 Sets coefficients for the linear SVM classifier.
415
416 .. ocv:function:: void ocl::HOGDescriptor::setSVMDetector(const vector<float>& detector)
417
418
419
420 ocl::HOGDescriptor::getDefaultPeopleDetector
421 ------------------------------------------------
422 Returns coefficients of the classifier trained for people detection (for default window size).
423
424 .. ocv:function:: static vector<float> ocl::HOGDescriptor::getDefaultPeopleDetector()
425
426
427
428 ocl::HOGDescriptor::getPeopleDetector48x96
429 ----------------------------------------------
430 Returns coefficients of the classifier trained for people detection (for 48x96 windows).
431
432 .. ocv:function:: static vector<float> ocl::HOGDescriptor::getPeopleDetector48x96()
433
434
435
436 ocl::HOGDescriptor::getPeopleDetector64x128
437 -----------------------------------------------
438 Returns coefficients of the classifier trained for people detection (for 64x128 windows).
439
440 .. ocv:function:: static vector<float> ocl::HOGDescriptor::getPeopleDetector64x128()
441
442
443
444 ocl::HOGDescriptor::detect
445 ------------------------------
446 Performs object detection without a multi-scale window.
447
448 .. ocv:function:: void ocl::HOGDescriptor::detect(const oclMat& img, vector<Point>& found_locations, double hit_threshold=0, Size win_stride=Size(), Size padding=Size())
449
450    :param img: Source image.  ``CV_8UC1``  and  ``CV_8UC4`` types are supported for now.
451
452    :param found_locations: Left-top corner points of detected objects boundaries.
453
454    :param hit_threshold: Threshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specfied in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
455
456    :param win_stride: Window stride. It must be a multiple of block stride.
457
458    :param padding: Mock parameter to keep the CPU interface compatibility. It must be (0,0).
459
460
461
462 ocl::HOGDescriptor::detectMultiScale
463 ----------------------------------------
464 Performs object detection with a multi-scale window.
465
466 .. ocv:function:: void ocl::HOGDescriptor::detectMultiScale(const oclMat& img, vector<Rect>& found_locations, double hit_threshold=0, Size win_stride=Size(), Size padding=Size(), double scale0=1.05, int group_threshold=2)
467
468    :param img: Source image. See  :ocv:func:`ocl::HOGDescriptor::detect`  for type limitations.
469
470    :param found_locations: Detected objects boundaries.
471
472    :param hit_threshold: Threshold for the distance between features and SVM classifying plane. See  :ocv:func:`ocl::HOGDescriptor::detect`  for details.
473
474    :param win_stride: Window stride. It must be a multiple of block stride.
475
476    :param padding: Mock parameter to keep the CPU interface compatibility. It must be (0,0).
477
478    :param scale0: Coefficient of the detection window increase.
479
480    :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` .
481
482
483
484 ocl::HOGDescriptor::getDescriptors
485 --------------------------------------
486 Returns block descriptors computed for the whole image.
487
488 .. ocv:function:: void ocl::HOGDescriptor::getDescriptors(const oclMat& img, Size win_stride, oclMat& descriptors, int descr_format=DESCR_FORMAT_COL_BY_COL)
489
490    :param img: Source image. See  :ocv:func:`ocl::HOGDescriptor::detect`  for type limitations.
491
492    :param win_stride: Window stride. It must be a multiple of block stride.
493
494    :param descriptors: 2D array of descriptors.
495
496    :param descr_format: Descriptor storage format:
497
498         * **DESCR_FORMAT_ROW_BY_ROW** - Row-major order.
499
500         * **DESCR_FORMAT_COL_BY_COL** - Column-major order.
501
502 The function is mainly used to learn the classifier.