001//
002// This file is auto-generated. Please don't modify it!
003//
004package org.opencv.objdetect;
005
006import java.util.ArrayList;
007import java.util.List;
008import org.opencv.core.Mat;
009import org.opencv.core.MatOfDouble;
010import org.opencv.core.MatOfFloat;
011import org.opencv.core.MatOfPoint;
012import org.opencv.core.MatOfRect;
013import org.opencv.core.Size;
014import org.opencv.utils.Converters;
015
016// C++: class HOGDescriptor
017/**
018 * Implementation of HOG (Histogram of Oriented Gradients) descriptor and object detector.
019 *
020 * the HOG descriptor algorithm introduced by Navneet Dalal and Bill Triggs CITE: Dalal2005 .
021 *
022 * useful links:
023 *
024 * https://hal.inria.fr/inria-00548512/document/
025 *
026 * https://en.wikipedia.org/wiki/Histogram_of_oriented_gradients
027 *
028 * https://software.intel.com/en-us/ipp-dev-reference-histogram-of-oriented-gradients-hog-descriptor
029 *
030 * http://www.learnopencv.com/histogram-of-oriented-gradients
031 *
032 * http://www.learnopencv.com/handwritten-digits-classification-an-opencv-c-python-tutorial
033 */
034public class HOGDescriptor {
035
036    protected final long nativeObj;
037    protected HOGDescriptor(long addr) { nativeObj = addr; }
038
039    public long getNativeObjAddr() { return nativeObj; }
040
041    // internal usage only
042    public static HOGDescriptor __fromPtr__(long addr) { return new HOGDescriptor(addr); }
043
044    // C++: enum <unnamed>
045    public static final int
046            DEFAULT_NLEVELS = 64;
047
048
049    // C++: enum DescriptorStorageFormat (cv.HOGDescriptor.DescriptorStorageFormat)
050    public static final int
051            DESCR_FORMAT_COL_BY_COL = 0,
052            DESCR_FORMAT_ROW_BY_ROW = 1;
053
054
055    // C++: enum HistogramNormType (cv.HOGDescriptor.HistogramNormType)
056    public static final int
057            L2Hys = 0;
058
059
060    //
061    // C++:   cv::HOGDescriptor::HOGDescriptor()
062    //
063
064    /**
065     * Creates the HOG descriptor and detector with default params.
066     *
067     *     aqual to HOGDescriptor(Size(64,128), Size(16,16), Size(8,8), Size(8,8), 9 )
068     */
069    public HOGDescriptor() {
070        nativeObj = HOGDescriptor_0();
071    }
072
073
074    //
075    // C++:   cv::HOGDescriptor::HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture = 1, double _winSigma = -1, HOGDescriptor_HistogramNormType _histogramNormType = HOGDescriptor::L2Hys, double _L2HysThreshold = 0.2, bool _gammaCorrection = false, int _nlevels = HOGDescriptor::DEFAULT_NLEVELS, bool _signedGradient = false)
076    //
077
078    /**
079     *
080     *     @param _winSize sets winSize with given value.
081     *     @param _blockSize sets blockSize with given value.
082     *     @param _blockStride sets blockStride with given value.
083     *     @param _cellSize sets cellSize with given value.
084     *     @param _nbins sets nbins with given value.
085     *     @param _derivAperture sets derivAperture with given value.
086     *     @param _winSigma sets winSigma with given value.
087     *     @param _histogramNormType sets histogramNormType with given value.
088     *     @param _L2HysThreshold sets L2HysThreshold with given value.
089     *     @param _gammaCorrection sets gammaCorrection with given value.
090     *     @param _nlevels sets nlevels with given value.
091     *     @param _signedGradient sets signedGradient with given value.
092     */
093    public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType, double _L2HysThreshold, boolean _gammaCorrection, int _nlevels, boolean _signedGradient) {
094        nativeObj = HOGDescriptor_1(_winSize.width, _winSize.height, _blockSize.width, _blockSize.height, _blockStride.width, _blockStride.height, _cellSize.width, _cellSize.height, _nbins, _derivAperture, _winSigma, _histogramNormType, _L2HysThreshold, _gammaCorrection, _nlevels, _signedGradient);
095    }
096
097    /**
098     *
099     *     @param _winSize sets winSize with given value.
100     *     @param _blockSize sets blockSize with given value.
101     *     @param _blockStride sets blockStride with given value.
102     *     @param _cellSize sets cellSize with given value.
103     *     @param _nbins sets nbins with given value.
104     *     @param _derivAperture sets derivAperture with given value.
105     *     @param _winSigma sets winSigma with given value.
106     *     @param _histogramNormType sets histogramNormType with given value.
107     *     @param _L2HysThreshold sets L2HysThreshold with given value.
108     *     @param _gammaCorrection sets gammaCorrection with given value.
109     *     @param _nlevels sets nlevels with given value.
110     */
111    public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType, double _L2HysThreshold, boolean _gammaCorrection, int _nlevels) {
112        nativeObj = HOGDescriptor_2(_winSize.width, _winSize.height, _blockSize.width, _blockSize.height, _blockStride.width, _blockStride.height, _cellSize.width, _cellSize.height, _nbins, _derivAperture, _winSigma, _histogramNormType, _L2HysThreshold, _gammaCorrection, _nlevels);
113    }
114
115    /**
116     *
117     *     @param _winSize sets winSize with given value.
118     *     @param _blockSize sets blockSize with given value.
119     *     @param _blockStride sets blockStride with given value.
120     *     @param _cellSize sets cellSize with given value.
121     *     @param _nbins sets nbins with given value.
122     *     @param _derivAperture sets derivAperture with given value.
123     *     @param _winSigma sets winSigma with given value.
124     *     @param _histogramNormType sets histogramNormType with given value.
125     *     @param _L2HysThreshold sets L2HysThreshold with given value.
126     *     @param _gammaCorrection sets gammaCorrection with given value.
127     */
128    public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType, double _L2HysThreshold, boolean _gammaCorrection) {
129        nativeObj = HOGDescriptor_3(_winSize.width, _winSize.height, _blockSize.width, _blockSize.height, _blockStride.width, _blockStride.height, _cellSize.width, _cellSize.height, _nbins, _derivAperture, _winSigma, _histogramNormType, _L2HysThreshold, _gammaCorrection);
130    }
131
132    /**
133     *
134     *     @param _winSize sets winSize with given value.
135     *     @param _blockSize sets blockSize with given value.
136     *     @param _blockStride sets blockStride with given value.
137     *     @param _cellSize sets cellSize with given value.
138     *     @param _nbins sets nbins with given value.
139     *     @param _derivAperture sets derivAperture with given value.
140     *     @param _winSigma sets winSigma with given value.
141     *     @param _histogramNormType sets histogramNormType with given value.
142     *     @param _L2HysThreshold sets L2HysThreshold with given value.
143     */
144    public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType, double _L2HysThreshold) {
145        nativeObj = HOGDescriptor_4(_winSize.width, _winSize.height, _blockSize.width, _blockSize.height, _blockStride.width, _blockStride.height, _cellSize.width, _cellSize.height, _nbins, _derivAperture, _winSigma, _histogramNormType, _L2HysThreshold);
146    }
147
148    /**
149     *
150     *     @param _winSize sets winSize with given value.
151     *     @param _blockSize sets blockSize with given value.
152     *     @param _blockStride sets blockStride with given value.
153     *     @param _cellSize sets cellSize with given value.
154     *     @param _nbins sets nbins with given value.
155     *     @param _derivAperture sets derivAperture with given value.
156     *     @param _winSigma sets winSigma with given value.
157     *     @param _histogramNormType sets histogramNormType with given value.
158     */
159    public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType) {
160        nativeObj = HOGDescriptor_5(_winSize.width, _winSize.height, _blockSize.width, _blockSize.height, _blockStride.width, _blockStride.height, _cellSize.width, _cellSize.height, _nbins, _derivAperture, _winSigma, _histogramNormType);
161    }
162
163    /**
164     *
165     *     @param _winSize sets winSize with given value.
166     *     @param _blockSize sets blockSize with given value.
167     *     @param _blockStride sets blockStride with given value.
168     *     @param _cellSize sets cellSize with given value.
169     *     @param _nbins sets nbins with given value.
170     *     @param _derivAperture sets derivAperture with given value.
171     *     @param _winSigma sets winSigma with given value.
172     */
173    public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture, double _winSigma) {
174        nativeObj = HOGDescriptor_6(_winSize.width, _winSize.height, _blockSize.width, _blockSize.height, _blockStride.width, _blockStride.height, _cellSize.width, _cellSize.height, _nbins, _derivAperture, _winSigma);
175    }
176
177    /**
178     *
179     *     @param _winSize sets winSize with given value.
180     *     @param _blockSize sets blockSize with given value.
181     *     @param _blockStride sets blockStride with given value.
182     *     @param _cellSize sets cellSize with given value.
183     *     @param _nbins sets nbins with given value.
184     *     @param _derivAperture sets derivAperture with given value.
185     */
186    public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture) {
187        nativeObj = HOGDescriptor_7(_winSize.width, _winSize.height, _blockSize.width, _blockSize.height, _blockStride.width, _blockStride.height, _cellSize.width, _cellSize.height, _nbins, _derivAperture);
188    }
189
190    /**
191     *
192     *     @param _winSize sets winSize with given value.
193     *     @param _blockSize sets blockSize with given value.
194     *     @param _blockStride sets blockStride with given value.
195     *     @param _cellSize sets cellSize with given value.
196     *     @param _nbins sets nbins with given value.
197     */
198    public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins) {
199        nativeObj = HOGDescriptor_8(_winSize.width, _winSize.height, _blockSize.width, _blockSize.height, _blockStride.width, _blockStride.height, _cellSize.width, _cellSize.height, _nbins);
200    }
201
202
203    //
204    // C++:   cv::HOGDescriptor::HOGDescriptor(String filename)
205    //
206
207    /**
208     *
209     *     @param filename The file name containing HOGDescriptor properties and coefficients for the linear SVM classifier.
210     */
211    public HOGDescriptor(String filename) {
212        nativeObj = HOGDescriptor_9(filename);
213    }
214
215
216    //
217    // C++:  size_t cv::HOGDescriptor::getDescriptorSize()
218    //
219
220    /**
221     * Returns the number of coefficients required for the classification.
222     * @return automatically generated
223     */
224    public long getDescriptorSize() {
225        return getDescriptorSize_0(nativeObj);
226    }
227
228
229    //
230    // C++:  bool cv::HOGDescriptor::checkDetectorSize()
231    //
232
233    /**
234     * Checks if detector size equal to descriptor size.
235     * @return automatically generated
236     */
237    public boolean checkDetectorSize() {
238        return checkDetectorSize_0(nativeObj);
239    }
240
241
242    //
243    // C++:  double cv::HOGDescriptor::getWinSigma()
244    //
245
246    /**
247     * Returns winSigma value
248     * @return automatically generated
249     */
250    public double getWinSigma() {
251        return getWinSigma_0(nativeObj);
252    }
253
254
255    //
256    // C++:  void cv::HOGDescriptor::setSVMDetector(Mat svmdetector)
257    //
258
259    /**
260     * Sets coefficients for the linear SVM classifier.
261     *     @param svmdetector coefficients for the linear SVM classifier.
262     */
263    public void setSVMDetector(Mat svmdetector) {
264        setSVMDetector_0(nativeObj, svmdetector.nativeObj);
265    }
266
267
268    //
269    // C++:  bool cv::HOGDescriptor::load(String filename, String objname = String())
270    //
271
272    /**
273     * loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file.
274     *     @param filename Path of the file to read.
275     *     @param objname The optional name of the node to read (if empty, the first top-level node will be used).
276     * @return automatically generated
277     */
278    public boolean load(String filename, String objname) {
279        return load_0(nativeObj, filename, objname);
280    }
281
282    /**
283     * loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file.
284     *     @param filename Path of the file to read.
285     * @return automatically generated
286     */
287    public boolean load(String filename) {
288        return load_1(nativeObj, filename);
289    }
290
291
292    //
293    // C++:  void cv::HOGDescriptor::save(String filename, String objname = String())
294    //
295
296    /**
297     * saves HOGDescriptor parameters and coefficients for the linear SVM classifier to a file
298     *     @param filename File name
299     *     @param objname Object name
300     */
301    public void save(String filename, String objname) {
302        save_0(nativeObj, filename, objname);
303    }
304
305    /**
306     * saves HOGDescriptor parameters and coefficients for the linear SVM classifier to a file
307     *     @param filename File name
308     */
309    public void save(String filename) {
310        save_1(nativeObj, filename);
311    }
312
313
314    //
315    // C++:  void cv::HOGDescriptor::compute(Mat img, vector_float& descriptors, Size winStride = Size(), Size padding = Size(), vector_Point locations = std::vector<Point>())
316    //
317
318    /**
319     * Computes HOG descriptors of given image.
320     *     @param img Matrix of the type CV_8U containing an image where HOG features will be calculated.
321     *     @param descriptors Matrix of the type CV_32F
322     *     @param winStride Window stride. It must be a multiple of block stride.
323     *     @param padding Padding
324     *     @param locations Vector of Point
325     */
326    public void compute(Mat img, MatOfFloat descriptors, Size winStride, Size padding, MatOfPoint locations) {
327        Mat descriptors_mat = descriptors;
328        Mat locations_mat = locations;
329        compute_0(nativeObj, img.nativeObj, descriptors_mat.nativeObj, winStride.width, winStride.height, padding.width, padding.height, locations_mat.nativeObj);
330    }
331
332    /**
333     * Computes HOG descriptors of given image.
334     *     @param img Matrix of the type CV_8U containing an image where HOG features will be calculated.
335     *     @param descriptors Matrix of the type CV_32F
336     *     @param winStride Window stride. It must be a multiple of block stride.
337     *     @param padding Padding
338     */
339    public void compute(Mat img, MatOfFloat descriptors, Size winStride, Size padding) {
340        Mat descriptors_mat = descriptors;
341        compute_1(nativeObj, img.nativeObj, descriptors_mat.nativeObj, winStride.width, winStride.height, padding.width, padding.height);
342    }
343
344    /**
345     * Computes HOG descriptors of given image.
346     *     @param img Matrix of the type CV_8U containing an image where HOG features will be calculated.
347     *     @param descriptors Matrix of the type CV_32F
348     *     @param winStride Window stride. It must be a multiple of block stride.
349     */
350    public void compute(Mat img, MatOfFloat descriptors, Size winStride) {
351        Mat descriptors_mat = descriptors;
352        compute_2(nativeObj, img.nativeObj, descriptors_mat.nativeObj, winStride.width, winStride.height);
353    }
354
355    /**
356     * Computes HOG descriptors of given image.
357     *     @param img Matrix of the type CV_8U containing an image where HOG features will be calculated.
358     *     @param descriptors Matrix of the type CV_32F
359     */
360    public void compute(Mat img, MatOfFloat descriptors) {
361        Mat descriptors_mat = descriptors;
362        compute_3(nativeObj, img.nativeObj, descriptors_mat.nativeObj);
363    }
364
365
366    //
367    // C++:  void cv::HOGDescriptor::detect(Mat img, vector_Point& foundLocations, vector_double& weights, double hitThreshold = 0, Size winStride = Size(), Size padding = Size(), vector_Point searchLocations = std::vector<Point>())
368    //
369
370    /**
371     * Performs object detection without a multi-scale window.
372     *     @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
373     *     @param foundLocations Vector of point where each point contains left-top corner point of detected object boundaries.
374     *     @param weights Vector that will contain confidence values for each detected object.
375     *     @param hitThreshold Threshold for the distance between features and SVM classifying plane.
376     *     Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
377     *     But if the free coefficient is omitted (which is allowed), you can specify it manually here.
378     *     @param winStride Window stride. It must be a multiple of block stride.
379     *     @param padding Padding
380     *     @param searchLocations Vector of Point includes set of requested locations to be evaluated.
381     */
382    public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights, double hitThreshold, Size winStride, Size padding, MatOfPoint searchLocations) {
383        Mat foundLocations_mat = foundLocations;
384        Mat weights_mat = weights;
385        Mat searchLocations_mat = searchLocations;
386        detect_0(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj, hitThreshold, winStride.width, winStride.height, padding.width, padding.height, searchLocations_mat.nativeObj);
387    }
388
389    /**
390     * Performs object detection without a multi-scale window.
391     *     @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
392     *     @param foundLocations Vector of point where each point contains left-top corner point of detected object boundaries.
393     *     @param weights Vector that will contain confidence values for each detected object.
394     *     @param hitThreshold Threshold for the distance between features and SVM classifying plane.
395     *     Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
396     *     But if the free coefficient is omitted (which is allowed), you can specify it manually here.
397     *     @param winStride Window stride. It must be a multiple of block stride.
398     *     @param padding Padding
399     */
400    public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights, double hitThreshold, Size winStride, Size padding) {
401        Mat foundLocations_mat = foundLocations;
402        Mat weights_mat = weights;
403        detect_1(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj, hitThreshold, winStride.width, winStride.height, padding.width, padding.height);
404    }
405
406    /**
407     * Performs object detection without a multi-scale window.
408     *     @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
409     *     @param foundLocations Vector of point where each point contains left-top corner point of detected object boundaries.
410     *     @param weights Vector that will contain confidence values for each detected object.
411     *     @param hitThreshold Threshold for the distance between features and SVM classifying plane.
412     *     Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
413     *     But if the free coefficient is omitted (which is allowed), you can specify it manually here.
414     *     @param winStride Window stride. It must be a multiple of block stride.
415     */
416    public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights, double hitThreshold, Size winStride) {
417        Mat foundLocations_mat = foundLocations;
418        Mat weights_mat = weights;
419        detect_2(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj, hitThreshold, winStride.width, winStride.height);
420    }
421
422    /**
423     * Performs object detection without a multi-scale window.
424     *     @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
425     *     @param foundLocations Vector of point where each point contains left-top corner point of detected object boundaries.
426     *     @param weights Vector that will contain confidence values for each detected object.
427     *     @param hitThreshold Threshold for the distance between features and SVM classifying plane.
428     *     Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
429     *     But if the free coefficient is omitted (which is allowed), you can specify it manually here.
430     */
431    public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights, double hitThreshold) {
432        Mat foundLocations_mat = foundLocations;
433        Mat weights_mat = weights;
434        detect_3(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj, hitThreshold);
435    }
436
437    /**
438     * Performs object detection without a multi-scale window.
439     *     @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
440     *     @param foundLocations Vector of point where each point contains left-top corner point of detected object boundaries.
441     *     @param weights Vector that will contain confidence values for each detected object.
442     *     Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
443     *     But if the free coefficient is omitted (which is allowed), you can specify it manually here.
444     */
445    public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights) {
446        Mat foundLocations_mat = foundLocations;
447        Mat weights_mat = weights;
448        detect_4(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj);
449    }
450
451
452    //
453    // C++:  void cv::HOGDescriptor::detectMultiScale(Mat img, vector_Rect& foundLocations, vector_double& foundWeights, double hitThreshold = 0, Size winStride = Size(), Size padding = Size(), double scale = 1.05, double finalThreshold = 2.0, bool useMeanshiftGrouping = false)
454    //
455
456    /**
457     * Detects objects of different sizes in the input image. The detected objects are returned as a list
458     *     of rectangles.
459     *     @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
460     *     @param foundLocations Vector of rectangles where each rectangle contains the detected object.
461     *     @param foundWeights Vector that will contain confidence values for each detected object.
462     *     @param hitThreshold Threshold for the distance between features and SVM classifying plane.
463     *     Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
464     *     But if the free coefficient is omitted (which is allowed), you can specify it manually here.
465     *     @param winStride Window stride. It must be a multiple of block stride.
466     *     @param padding Padding
467     *     @param scale Coefficient of the detection window increase.
468     *     @param finalThreshold Final threshold
469     *     @param useMeanshiftGrouping indicates grouping algorithm
470     */
471    public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights, double hitThreshold, Size winStride, Size padding, double scale, double finalThreshold, boolean useMeanshiftGrouping) {
472        Mat foundLocations_mat = foundLocations;
473        Mat foundWeights_mat = foundWeights;
474        detectMultiScale_0(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, foundWeights_mat.nativeObj, hitThreshold, winStride.width, winStride.height, padding.width, padding.height, scale, finalThreshold, useMeanshiftGrouping);
475    }
476
477    /**
478     * Detects objects of different sizes in the input image. The detected objects are returned as a list
479     *     of rectangles.
480     *     @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
481     *     @param foundLocations Vector of rectangles where each rectangle contains the detected object.
482     *     @param foundWeights Vector that will contain confidence values for each detected object.
483     *     @param hitThreshold Threshold for the distance between features and SVM classifying plane.
484     *     Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
485     *     But if the free coefficient is omitted (which is allowed), you can specify it manually here.
486     *     @param winStride Window stride. It must be a multiple of block stride.
487     *     @param padding Padding
488     *     @param scale Coefficient of the detection window increase.
489     *     @param finalThreshold Final threshold
490     */
491    public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights, double hitThreshold, Size winStride, Size padding, double scale, double finalThreshold) {
492        Mat foundLocations_mat = foundLocations;
493        Mat foundWeights_mat = foundWeights;
494        detectMultiScale_1(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, foundWeights_mat.nativeObj, hitThreshold, winStride.width, winStride.height, padding.width, padding.height, scale, finalThreshold);
495    }
496
497    /**
498     * Detects objects of different sizes in the input image. The detected objects are returned as a list
499     *     of rectangles.
500     *     @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
501     *     @param foundLocations Vector of rectangles where each rectangle contains the detected object.
502     *     @param foundWeights Vector that will contain confidence values for each detected object.
503     *     @param hitThreshold Threshold for the distance between features and SVM classifying plane.
504     *     Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
505     *     But if the free coefficient is omitted (which is allowed), you can specify it manually here.
506     *     @param winStride Window stride. It must be a multiple of block stride.
507     *     @param padding Padding
508     *     @param scale Coefficient of the detection window increase.
509     */
510    public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights, double hitThreshold, Size winStride, Size padding, double scale) {
511        Mat foundLocations_mat = foundLocations;
512        Mat foundWeights_mat = foundWeights;
513        detectMultiScale_2(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, foundWeights_mat.nativeObj, hitThreshold, winStride.width, winStride.height, padding.width, padding.height, scale);
514    }
515
516    /**
517     * Detects objects of different sizes in the input image. The detected objects are returned as a list
518     *     of rectangles.
519     *     @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
520     *     @param foundLocations Vector of rectangles where each rectangle contains the detected object.
521     *     @param foundWeights Vector that will contain confidence values for each detected object.
522     *     @param hitThreshold Threshold for the distance between features and SVM classifying plane.
523     *     Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
524     *     But if the free coefficient is omitted (which is allowed), you can specify it manually here.
525     *     @param winStride Window stride. It must be a multiple of block stride.
526     *     @param padding Padding
527     */
528    public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights, double hitThreshold, Size winStride, Size padding) {
529        Mat foundLocations_mat = foundLocations;
530        Mat foundWeights_mat = foundWeights;
531        detectMultiScale_3(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, foundWeights_mat.nativeObj, hitThreshold, winStride.width, winStride.height, padding.width, padding.height);
532    }
533
534    /**
535     * Detects objects of different sizes in the input image. The detected objects are returned as a list
536     *     of rectangles.
537     *     @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
538     *     @param foundLocations Vector of rectangles where each rectangle contains the detected object.
539     *     @param foundWeights Vector that will contain confidence values for each detected object.
540     *     @param hitThreshold Threshold for the distance between features and SVM classifying plane.
541     *     Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
542     *     But if the free coefficient is omitted (which is allowed), you can specify it manually here.
543     *     @param winStride Window stride. It must be a multiple of block stride.
544     */
545    public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights, double hitThreshold, Size winStride) {
546        Mat foundLocations_mat = foundLocations;
547        Mat foundWeights_mat = foundWeights;
548        detectMultiScale_4(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, foundWeights_mat.nativeObj, hitThreshold, winStride.width, winStride.height);
549    }
550
551    /**
552     * Detects objects of different sizes in the input image. The detected objects are returned as a list
553     *     of rectangles.
554     *     @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
555     *     @param foundLocations Vector of rectangles where each rectangle contains the detected object.
556     *     @param foundWeights Vector that will contain confidence values for each detected object.
557     *     @param hitThreshold Threshold for the distance between features and SVM classifying plane.
558     *     Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
559     *     But if the free coefficient is omitted (which is allowed), you can specify it manually here.
560     */
561    public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights, double hitThreshold) {
562        Mat foundLocations_mat = foundLocations;
563        Mat foundWeights_mat = foundWeights;
564        detectMultiScale_5(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, foundWeights_mat.nativeObj, hitThreshold);
565    }
566
567    /**
568     * Detects objects of different sizes in the input image. The detected objects are returned as a list
569     *     of rectangles.
570     *     @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
571     *     @param foundLocations Vector of rectangles where each rectangle contains the detected object.
572     *     @param foundWeights Vector that will contain confidence values for each detected object.
573     *     Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
574     *     But if the free coefficient is omitted (which is allowed), you can specify it manually here.
575     */
576    public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights) {
577        Mat foundLocations_mat = foundLocations;
578        Mat foundWeights_mat = foundWeights;
579        detectMultiScale_6(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, foundWeights_mat.nativeObj);
580    }
581
582
583    //
584    // C++:  void cv::HOGDescriptor::computeGradient(Mat img, Mat& grad, Mat& angleOfs, Size paddingTL = Size(), Size paddingBR = Size())
585    //
586
587    /**
588     *  Computes gradients and quantized gradient orientations.
589     *     @param img Matrix contains the image to be computed
590     *     @param grad Matrix of type CV_32FC2 contains computed gradients
591     *     @param angleOfs Matrix of type CV_8UC2 contains quantized gradient orientations
592     *     @param paddingTL Padding from top-left
593     *     @param paddingBR Padding from bottom-right
594     */
595    public void computeGradient(Mat img, Mat grad, Mat angleOfs, Size paddingTL, Size paddingBR) {
596        computeGradient_0(nativeObj, img.nativeObj, grad.nativeObj, angleOfs.nativeObj, paddingTL.width, paddingTL.height, paddingBR.width, paddingBR.height);
597    }
598
599    /**
600     *  Computes gradients and quantized gradient orientations.
601     *     @param img Matrix contains the image to be computed
602     *     @param grad Matrix of type CV_32FC2 contains computed gradients
603     *     @param angleOfs Matrix of type CV_8UC2 contains quantized gradient orientations
604     *     @param paddingTL Padding from top-left
605     */
606    public void computeGradient(Mat img, Mat grad, Mat angleOfs, Size paddingTL) {
607        computeGradient_1(nativeObj, img.nativeObj, grad.nativeObj, angleOfs.nativeObj, paddingTL.width, paddingTL.height);
608    }
609
610    /**
611     *  Computes gradients and quantized gradient orientations.
612     *     @param img Matrix contains the image to be computed
613     *     @param grad Matrix of type CV_32FC2 contains computed gradients
614     *     @param angleOfs Matrix of type CV_8UC2 contains quantized gradient orientations
615     */
616    public void computeGradient(Mat img, Mat grad, Mat angleOfs) {
617        computeGradient_2(nativeObj, img.nativeObj, grad.nativeObj, angleOfs.nativeObj);
618    }
619
620
621    //
622    // C++: static vector_float cv::HOGDescriptor::getDefaultPeopleDetector()
623    //
624
625    /**
626     * Returns coefficients of the classifier trained for people detection (for 64x128 windows).
627     * @return automatically generated
628     */
629    public static MatOfFloat getDefaultPeopleDetector() {
630        return MatOfFloat.fromNativeAddr(getDefaultPeopleDetector_0());
631    }
632
633
634    //
635    // C++: static vector_float cv::HOGDescriptor::getDaimlerPeopleDetector()
636    //
637
638    /**
639     * Returns coefficients of the classifier trained for people detection (for 48x96 windows).
640     * @return automatically generated
641     */
642    public static MatOfFloat getDaimlerPeopleDetector() {
643        return MatOfFloat.fromNativeAddr(getDaimlerPeopleDetector_0());
644    }
645
646
647    //
648    // C++: Size HOGDescriptor::winSize
649    //
650
651    public Size get_winSize() {
652        return new Size(get_winSize_0(nativeObj));
653    }
654
655
656    //
657    // C++: Size HOGDescriptor::blockSize
658    //
659
660    public Size get_blockSize() {
661        return new Size(get_blockSize_0(nativeObj));
662    }
663
664
665    //
666    // C++: Size HOGDescriptor::blockStride
667    //
668
669    public Size get_blockStride() {
670        return new Size(get_blockStride_0(nativeObj));
671    }
672
673
674    //
675    // C++: Size HOGDescriptor::cellSize
676    //
677
678    public Size get_cellSize() {
679        return new Size(get_cellSize_0(nativeObj));
680    }
681
682
683    //
684    // C++: int HOGDescriptor::nbins
685    //
686
687    public int get_nbins() {
688        return get_nbins_0(nativeObj);
689    }
690
691
692    //
693    // C++: int HOGDescriptor::derivAperture
694    //
695
696    public int get_derivAperture() {
697        return get_derivAperture_0(nativeObj);
698    }
699
700
701    //
702    // C++: double HOGDescriptor::winSigma
703    //
704
705    public double get_winSigma() {
706        return get_winSigma_0(nativeObj);
707    }
708
709
710    //
711    // C++: HOGDescriptor_HistogramNormType HOGDescriptor::histogramNormType
712    //
713
714    public int get_histogramNormType() {
715        return get_histogramNormType_0(nativeObj);
716    }
717
718
719    //
720    // C++: double HOGDescriptor::L2HysThreshold
721    //
722
723    public double get_L2HysThreshold() {
724        return get_L2HysThreshold_0(nativeObj);
725    }
726
727
728    //
729    // C++: bool HOGDescriptor::gammaCorrection
730    //
731
732    public boolean get_gammaCorrection() {
733        return get_gammaCorrection_0(nativeObj);
734    }
735
736
737    //
738    // C++: vector_float HOGDescriptor::svmDetector
739    //
740
741    public MatOfFloat get_svmDetector() {
742        return MatOfFloat.fromNativeAddr(get_svmDetector_0(nativeObj));
743    }
744
745
746    //
747    // C++: int HOGDescriptor::nlevels
748    //
749
750    public int get_nlevels() {
751        return get_nlevels_0(nativeObj);
752    }
753
754
755    //
756    // C++: bool HOGDescriptor::signedGradient
757    //
758
759    public boolean get_signedGradient() {
760        return get_signedGradient_0(nativeObj);
761    }
762
763
764    @Override
765    protected void finalize() throws Throwable {
766        delete(nativeObj);
767    }
768
769
770
771    // C++:   cv::HOGDescriptor::HOGDescriptor()
772    private static native long HOGDescriptor_0();
773
774    // C++:   cv::HOGDescriptor::HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture = 1, double _winSigma = -1, HOGDescriptor_HistogramNormType _histogramNormType = HOGDescriptor::L2Hys, double _L2HysThreshold = 0.2, bool _gammaCorrection = false, int _nlevels = HOGDescriptor::DEFAULT_NLEVELS, bool _signedGradient = false)
775    private static native long HOGDescriptor_1(double _winSize_width, double _winSize_height, double _blockSize_width, double _blockSize_height, double _blockStride_width, double _blockStride_height, double _cellSize_width, double _cellSize_height, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType, double _L2HysThreshold, boolean _gammaCorrection, int _nlevels, boolean _signedGradient);
776    private static native long HOGDescriptor_2(double _winSize_width, double _winSize_height, double _blockSize_width, double _blockSize_height, double _blockStride_width, double _blockStride_height, double _cellSize_width, double _cellSize_height, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType, double _L2HysThreshold, boolean _gammaCorrection, int _nlevels);
777    private static native long HOGDescriptor_3(double _winSize_width, double _winSize_height, double _blockSize_width, double _blockSize_height, double _blockStride_width, double _blockStride_height, double _cellSize_width, double _cellSize_height, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType, double _L2HysThreshold, boolean _gammaCorrection);
778    private static native long HOGDescriptor_4(double _winSize_width, double _winSize_height, double _blockSize_width, double _blockSize_height, double _blockStride_width, double _blockStride_height, double _cellSize_width, double _cellSize_height, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType, double _L2HysThreshold);
779    private static native long HOGDescriptor_5(double _winSize_width, double _winSize_height, double _blockSize_width, double _blockSize_height, double _blockStride_width, double _blockStride_height, double _cellSize_width, double _cellSize_height, int _nbins, int _derivAperture, double _winSigma, int _histogramNormType);
780    private static native long HOGDescriptor_6(double _winSize_width, double _winSize_height, double _blockSize_width, double _blockSize_height, double _blockStride_width, double _blockStride_height, double _cellSize_width, double _cellSize_height, int _nbins, int _derivAperture, double _winSigma);
781    private static native long HOGDescriptor_7(double _winSize_width, double _winSize_height, double _blockSize_width, double _blockSize_height, double _blockStride_width, double _blockStride_height, double _cellSize_width, double _cellSize_height, int _nbins, int _derivAperture);
782    private static native long HOGDescriptor_8(double _winSize_width, double _winSize_height, double _blockSize_width, double _blockSize_height, double _blockStride_width, double _blockStride_height, double _cellSize_width, double _cellSize_height, int _nbins);
783
784    // C++:   cv::HOGDescriptor::HOGDescriptor(String filename)
785    private static native long HOGDescriptor_9(String filename);
786
787    // C++:  size_t cv::HOGDescriptor::getDescriptorSize()
788    private static native long getDescriptorSize_0(long nativeObj);
789
790    // C++:  bool cv::HOGDescriptor::checkDetectorSize()
791    private static native boolean checkDetectorSize_0(long nativeObj);
792
793    // C++:  double cv::HOGDescriptor::getWinSigma()
794    private static native double getWinSigma_0(long nativeObj);
795
796    // C++:  void cv::HOGDescriptor::setSVMDetector(Mat svmdetector)
797    private static native void setSVMDetector_0(long nativeObj, long svmdetector_nativeObj);
798
799    // C++:  bool cv::HOGDescriptor::load(String filename, String objname = String())
800    private static native boolean load_0(long nativeObj, String filename, String objname);
801    private static native boolean load_1(long nativeObj, String filename);
802
803    // C++:  void cv::HOGDescriptor::save(String filename, String objname = String())
804    private static native void save_0(long nativeObj, String filename, String objname);
805    private static native void save_1(long nativeObj, String filename);
806
807    // C++:  void cv::HOGDescriptor::compute(Mat img, vector_float& descriptors, Size winStride = Size(), Size padding = Size(), vector_Point locations = std::vector<Point>())
808    private static native void compute_0(long nativeObj, long img_nativeObj, long descriptors_mat_nativeObj, double winStride_width, double winStride_height, double padding_width, double padding_height, long locations_mat_nativeObj);
809    private static native void compute_1(long nativeObj, long img_nativeObj, long descriptors_mat_nativeObj, double winStride_width, double winStride_height, double padding_width, double padding_height);
810    private static native void compute_2(long nativeObj, long img_nativeObj, long descriptors_mat_nativeObj, double winStride_width, double winStride_height);
811    private static native void compute_3(long nativeObj, long img_nativeObj, long descriptors_mat_nativeObj);
812
813    // C++:  void cv::HOGDescriptor::detect(Mat img, vector_Point& foundLocations, vector_double& weights, double hitThreshold = 0, Size winStride = Size(), Size padding = Size(), vector_Point searchLocations = std::vector<Point>())
814    private static native void detect_0(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long weights_mat_nativeObj, double hitThreshold, double winStride_width, double winStride_height, double padding_width, double padding_height, long searchLocations_mat_nativeObj);
815    private static native void detect_1(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long weights_mat_nativeObj, double hitThreshold, double winStride_width, double winStride_height, double padding_width, double padding_height);
816    private static native void detect_2(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long weights_mat_nativeObj, double hitThreshold, double winStride_width, double winStride_height);
817    private static native void detect_3(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long weights_mat_nativeObj, double hitThreshold);
818    private static native void detect_4(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long weights_mat_nativeObj);
819
820    // C++:  void cv::HOGDescriptor::detectMultiScale(Mat img, vector_Rect& foundLocations, vector_double& foundWeights, double hitThreshold = 0, Size winStride = Size(), Size padding = Size(), double scale = 1.05, double finalThreshold = 2.0, bool useMeanshiftGrouping = false)
821    private static native void detectMultiScale_0(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long foundWeights_mat_nativeObj, double hitThreshold, double winStride_width, double winStride_height, double padding_width, double padding_height, double scale, double finalThreshold, boolean useMeanshiftGrouping);
822    private static native void detectMultiScale_1(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long foundWeights_mat_nativeObj, double hitThreshold, double winStride_width, double winStride_height, double padding_width, double padding_height, double scale, double finalThreshold);
823    private static native void detectMultiScale_2(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long foundWeights_mat_nativeObj, double hitThreshold, double winStride_width, double winStride_height, double padding_width, double padding_height, double scale);
824    private static native void detectMultiScale_3(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long foundWeights_mat_nativeObj, double hitThreshold, double winStride_width, double winStride_height, double padding_width, double padding_height);
825    private static native void detectMultiScale_4(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long foundWeights_mat_nativeObj, double hitThreshold, double winStride_width, double winStride_height);
826    private static native void detectMultiScale_5(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long foundWeights_mat_nativeObj, double hitThreshold);
827    private static native void detectMultiScale_6(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long foundWeights_mat_nativeObj);
828
829    // C++:  void cv::HOGDescriptor::computeGradient(Mat img, Mat& grad, Mat& angleOfs, Size paddingTL = Size(), Size paddingBR = Size())
830    private static native void computeGradient_0(long nativeObj, long img_nativeObj, long grad_nativeObj, long angleOfs_nativeObj, double paddingTL_width, double paddingTL_height, double paddingBR_width, double paddingBR_height);
831    private static native void computeGradient_1(long nativeObj, long img_nativeObj, long grad_nativeObj, long angleOfs_nativeObj, double paddingTL_width, double paddingTL_height);
832    private static native void computeGradient_2(long nativeObj, long img_nativeObj, long grad_nativeObj, long angleOfs_nativeObj);
833
834    // C++: static vector_float cv::HOGDescriptor::getDefaultPeopleDetector()
835    private static native long getDefaultPeopleDetector_0();
836
837    // C++: static vector_float cv::HOGDescriptor::getDaimlerPeopleDetector()
838    private static native long getDaimlerPeopleDetector_0();
839
840    // C++: Size HOGDescriptor::winSize
841    private static native double[] get_winSize_0(long nativeObj);
842
843    // C++: Size HOGDescriptor::blockSize
844    private static native double[] get_blockSize_0(long nativeObj);
845
846    // C++: Size HOGDescriptor::blockStride
847    private static native double[] get_blockStride_0(long nativeObj);
848
849    // C++: Size HOGDescriptor::cellSize
850    private static native double[] get_cellSize_0(long nativeObj);
851
852    // C++: int HOGDescriptor::nbins
853    private static native int get_nbins_0(long nativeObj);
854
855    // C++: int HOGDescriptor::derivAperture
856    private static native int get_derivAperture_0(long nativeObj);
857
858    // C++: double HOGDescriptor::winSigma
859    private static native double get_winSigma_0(long nativeObj);
860
861    // C++: HOGDescriptor_HistogramNormType HOGDescriptor::histogramNormType
862    private static native int get_histogramNormType_0(long nativeObj);
863
864    // C++: double HOGDescriptor::L2HysThreshold
865    private static native double get_L2HysThreshold_0(long nativeObj);
866
867    // C++: bool HOGDescriptor::gammaCorrection
868    private static native boolean get_gammaCorrection_0(long nativeObj);
869
870    // C++: vector_float HOGDescriptor::svmDetector
871    private static native long get_svmDetector_0(long nativeObj);
872
873    // C++: int HOGDescriptor::nlevels
874    private static native int get_nlevels_0(long nativeObj);
875
876    // C++: bool HOGDescriptor::signedGradient
877    private static native boolean get_signedGradient_0(long nativeObj);
878
879    // native support for java finalize()
880    private static native void delete(long nativeObj);
881
882}