1 2 // 3 // This file is auto-generated. Please don't modify it! 4 // 5 package org.opencv.objdetect; 6 7 import java.lang.String; 8 import java.util.ArrayList; 9 import org.opencv.core.Mat; 10 import org.opencv.core.MatOfDouble; 11 import org.opencv.core.MatOfFloat; 12 import org.opencv.core.MatOfPoint; 13 import org.opencv.core.MatOfRect; 14 import org.opencv.core.Size; 15 16 // C++: class HOGDescriptor 17 //javadoc: HOGDescriptor 18 public class HOGDescriptor { 19 20 protected final long nativeObj; 21 protected HOGDescriptor(long addr) { nativeObj = addr; } 22 23 24 public static final int 25 L2Hys = 0, 26 DEFAULT_NLEVELS = 64; 27 28 29 // 30 // C++: HOGDescriptor() 31 // 32 33 //javadoc: HOGDescriptor::HOGDescriptor() 34 public HOGDescriptor() 35 { 36 37 nativeObj = HOGDescriptor_0(); 38 39 return; 40 } 41 42 43 // 44 // C++: HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture = 1, double _winSigma = -1, int _histogramNormType = HOGDescriptor::L2Hys, double _L2HysThreshold = 0.2, bool _gammaCorrection = false, int _nlevels = HOGDescriptor::DEFAULT_NLEVELS, bool _signedGradient = false) 45 // 46 47 //javadoc: HOGDescriptor::HOGDescriptor(_winSize, _blockSize, _blockStride, _cellSize, _nbins, _derivAperture, _winSigma, _histogramNormType, _L2HysThreshold, _gammaCorrection, _nlevels, _signedGradient) 48 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) 49 { 50 51 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); 52 53 return; 54 } 55 56 //javadoc: HOGDescriptor::HOGDescriptor(_winSize, _blockSize, _blockStride, _cellSize, _nbins) 57 public HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins) 58 { 59 60 nativeObj = HOGDescriptor_2(_winSize.width, _winSize.height, _blockSize.width, _blockSize.height, _blockStride.width, _blockStride.height, _cellSize.width, _cellSize.height, _nbins); 61 62 return; 63 } 64 65 66 // 67 // C++: HOGDescriptor(String filename) 68 // 69 70 //javadoc: HOGDescriptor::HOGDescriptor(filename) 71 public HOGDescriptor(String filename) 72 { 73 74 nativeObj = HOGDescriptor_3(filename); 75 76 return; 77 } 78 79 80 // 81 // C++: size_t getDescriptorSize() 82 // 83 84 //javadoc: HOGDescriptor::getDescriptorSize() 85 public long getDescriptorSize() 86 { 87 88 long retVal = getDescriptorSize_0(nativeObj); 89 90 return retVal; 91 } 92 93 94 // 95 // C++: bool checkDetectorSize() 96 // 97 98 //javadoc: HOGDescriptor::checkDetectorSize() 99 public boolean checkDetectorSize() 100 { 101 102 boolean retVal = checkDetectorSize_0(nativeObj); 103 104 return retVal; 105 } 106 107 108 // 109 // C++: double getWinSigma() 110 // 111 112 //javadoc: HOGDescriptor::getWinSigma() 113 public double getWinSigma() 114 { 115 116 double retVal = getWinSigma_0(nativeObj); 117 118 return retVal; 119 } 120 121 122 // 123 // C++: void setSVMDetector(Mat _svmdetector) 124 // 125 126 //javadoc: HOGDescriptor::setSVMDetector(_svmdetector) 127 public void setSVMDetector(Mat _svmdetector) 128 { 129 130 setSVMDetector_0(nativeObj, _svmdetector.nativeObj); 131 132 return; 133 } 134 135 136 // 137 // C++: bool load(String filename, String objname = String()) 138 // 139 140 //javadoc: HOGDescriptor::load(filename, objname) 141 public boolean load(String filename, String objname) 142 { 143 144 boolean retVal = load_0(nativeObj, filename, objname); 145 146 return retVal; 147 } 148 149 //javadoc: HOGDescriptor::load(filename) 150 public boolean load(String filename) 151 { 152 153 boolean retVal = load_1(nativeObj, filename); 154 155 return retVal; 156 } 157 158 159 // 160 // C++: void save(String filename, String objname = String()) 161 // 162 163 //javadoc: HOGDescriptor::save(filename, objname) 164 public void save(String filename, String objname) 165 { 166 167 save_0(nativeObj, filename, objname); 168 169 return; 170 } 171 172 //javadoc: HOGDescriptor::save(filename) 173 public void save(String filename) 174 { 175 176 save_1(nativeObj, filename); 177 178 return; 179 } 180 181 182 // 183 // C++: void compute(Mat img, vector_float& descriptors, Size winStride = Size(), Size padding = Size(), vector_Point locations = std::vector<Point>()) 184 // 185 186 //javadoc: HOGDescriptor::compute(img, descriptors, winStride, padding, locations) 187 public void compute(Mat img, MatOfFloat descriptors, Size winStride, Size padding, MatOfPoint locations) 188 { 189 Mat descriptors_mat = descriptors; 190 Mat locations_mat = locations; 191 compute_0(nativeObj, img.nativeObj, descriptors_mat.nativeObj, winStride.width, winStride.height, padding.width, padding.height, locations_mat.nativeObj); 192 193 return; 194 } 195 196 //javadoc: HOGDescriptor::compute(img, descriptors) 197 public void compute(Mat img, MatOfFloat descriptors) 198 { 199 Mat descriptors_mat = descriptors; 200 compute_1(nativeObj, img.nativeObj, descriptors_mat.nativeObj); 201 202 return; 203 } 204 205 206 // 207 // C++: void detect(Mat img, vector_Point& foundLocations, vector_double& weights, double hitThreshold = 0, Size winStride = Size(), Size padding = Size(), vector_Point searchLocations = std::vector<Point>()) 208 // 209 210 //javadoc: HOGDescriptor::detect(img, foundLocations, weights, hitThreshold, winStride, padding, searchLocations) 211 public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights, double hitThreshold, Size winStride, Size padding, MatOfPoint searchLocations) 212 { 213 Mat foundLocations_mat = foundLocations; 214 Mat weights_mat = weights; 215 Mat searchLocations_mat = searchLocations; 216 detect_0(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj, hitThreshold, winStride.width, winStride.height, padding.width, padding.height, searchLocations_mat.nativeObj); 217 218 return; 219 } 220 221 //javadoc: HOGDescriptor::detect(img, foundLocations, weights) 222 public void detect(Mat img, MatOfPoint foundLocations, MatOfDouble weights) 223 { 224 Mat foundLocations_mat = foundLocations; 225 Mat weights_mat = weights; 226 detect_1(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, weights_mat.nativeObj); 227 228 return; 229 } 230 231 232 // 233 // C++: void 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) 234 // 235 236 //javadoc: HOGDescriptor::detectMultiScale(img, foundLocations, foundWeights, hitThreshold, winStride, padding, scale, finalThreshold, useMeanshiftGrouping) 237 public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights, double hitThreshold, Size winStride, Size padding, double scale, double finalThreshold, boolean useMeanshiftGrouping) 238 { 239 Mat foundLocations_mat = foundLocations; 240 Mat foundWeights_mat = foundWeights; 241 detectMultiScale_0(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, foundWeights_mat.nativeObj, hitThreshold, winStride.width, winStride.height, padding.width, padding.height, scale, finalThreshold, useMeanshiftGrouping); 242 243 return; 244 } 245 246 //javadoc: HOGDescriptor::detectMultiScale(img, foundLocations, foundWeights) 247 public void detectMultiScale(Mat img, MatOfRect foundLocations, MatOfDouble foundWeights) 248 { 249 Mat foundLocations_mat = foundLocations; 250 Mat foundWeights_mat = foundWeights; 251 detectMultiScale_1(nativeObj, img.nativeObj, foundLocations_mat.nativeObj, foundWeights_mat.nativeObj); 252 253 return; 254 } 255 256 257 // 258 // C++: void computeGradient(Mat img, Mat& grad, Mat& angleOfs, Size paddingTL = Size(), Size paddingBR = Size()) 259 // 260 261 //javadoc: HOGDescriptor::computeGradient(img, grad, angleOfs, paddingTL, paddingBR) 262 public void computeGradient(Mat img, Mat grad, Mat angleOfs, Size paddingTL, Size paddingBR) 263 { 264 265 computeGradient_0(nativeObj, img.nativeObj, grad.nativeObj, angleOfs.nativeObj, paddingTL.width, paddingTL.height, paddingBR.width, paddingBR.height); 266 267 return; 268 } 269 270 //javadoc: HOGDescriptor::computeGradient(img, grad, angleOfs) 271 public void computeGradient(Mat img, Mat grad, Mat angleOfs) 272 { 273 274 computeGradient_1(nativeObj, img.nativeObj, grad.nativeObj, angleOfs.nativeObj); 275 276 return; 277 } 278 279 280 // 281 // C++: static vector_float getDefaultPeopleDetector() 282 // 283 284 //javadoc: HOGDescriptor::getDefaultPeopleDetector() 285 public static MatOfFloat getDefaultPeopleDetector() 286 { 287 288 MatOfFloat retVal = MatOfFloat.fromNativeAddr(getDefaultPeopleDetector_0()); 289 290 return retVal; 291 } 292 293 294 // 295 // C++: static vector_float getDaimlerPeopleDetector() 296 // 297 298 //javadoc: HOGDescriptor::getDaimlerPeopleDetector() 299 public static MatOfFloat getDaimlerPeopleDetector() 300 { 301 302 MatOfFloat retVal = MatOfFloat.fromNativeAddr(getDaimlerPeopleDetector_0()); 303 304 return retVal; 305 } 306 307 308 // 309 // C++: Size HOGDescriptor::winSize 310 // 311 312 //javadoc: HOGDescriptor::get_winSize() 313 public Size get_winSize() 314 { 315 316 Size retVal = new Size(get_winSize_0(nativeObj)); 317 318 return retVal; 319 } 320 321 322 // 323 // C++: Size HOGDescriptor::blockSize 324 // 325 326 //javadoc: HOGDescriptor::get_blockSize() 327 public Size get_blockSize() 328 { 329 330 Size retVal = new Size(get_blockSize_0(nativeObj)); 331 332 return retVal; 333 } 334 335 336 // 337 // C++: Size HOGDescriptor::blockStride 338 // 339 340 //javadoc: HOGDescriptor::get_blockStride() 341 public Size get_blockStride() 342 { 343 344 Size retVal = new Size(get_blockStride_0(nativeObj)); 345 346 return retVal; 347 } 348 349 350 // 351 // C++: Size HOGDescriptor::cellSize 352 // 353 354 //javadoc: HOGDescriptor::get_cellSize() 355 public Size get_cellSize() 356 { 357 358 Size retVal = new Size(get_cellSize_0(nativeObj)); 359 360 return retVal; 361 } 362 363 364 // 365 // C++: int HOGDescriptor::nbins 366 // 367 368 //javadoc: HOGDescriptor::get_nbins() 369 public int get_nbins() 370 { 371 372 int retVal = get_nbins_0(nativeObj); 373 374 return retVal; 375 } 376 377 378 // 379 // C++: int HOGDescriptor::derivAperture 380 // 381 382 //javadoc: HOGDescriptor::get_derivAperture() 383 public int get_derivAperture() 384 { 385 386 int retVal = get_derivAperture_0(nativeObj); 387 388 return retVal; 389 } 390 391 392 // 393 // C++: double HOGDescriptor::winSigma 394 // 395 396 //javadoc: HOGDescriptor::get_winSigma() 397 public double get_winSigma() 398 { 399 400 double retVal = get_winSigma_0(nativeObj); 401 402 return retVal; 403 } 404 405 406 // 407 // C++: int HOGDescriptor::histogramNormType 408 // 409 410 //javadoc: HOGDescriptor::get_histogramNormType() 411 public int get_histogramNormType() 412 { 413 414 int retVal = get_histogramNormType_0(nativeObj); 415 416 return retVal; 417 } 418 419 420 // 421 // C++: double HOGDescriptor::L2HysThreshold 422 // 423 424 //javadoc: HOGDescriptor::get_L2HysThreshold() 425 public double get_L2HysThreshold() 426 { 427 428 double retVal = get_L2HysThreshold_0(nativeObj); 429 430 return retVal; 431 } 432 433 434 // 435 // C++: bool HOGDescriptor::gammaCorrection 436 // 437 438 //javadoc: HOGDescriptor::get_gammaCorrection() 439 public boolean get_gammaCorrection() 440 { 441 442 boolean retVal = get_gammaCorrection_0(nativeObj); 443 444 return retVal; 445 } 446 447 448 // 449 // C++: vector_float HOGDescriptor::svmDetector 450 // 451 452 //javadoc: HOGDescriptor::get_svmDetector() 453 public MatOfFloat get_svmDetector() 454 { 455 456 MatOfFloat retVal = MatOfFloat.fromNativeAddr(get_svmDetector_0(nativeObj)); 457 458 return retVal; 459 } 460 461 462 // 463 // C++: int HOGDescriptor::nlevels 464 // 465 466 //javadoc: HOGDescriptor::get_nlevels() 467 public int get_nlevels() 468 { 469 470 int retVal = get_nlevels_0(nativeObj); 471 472 return retVal; 473 } 474 475 476 // 477 // C++: bool HOGDescriptor::signedGradient 478 // 479 480 //javadoc: HOGDescriptor::get_signedGradient() 481 public boolean get_signedGradient() 482 { 483 484 boolean retVal = get_signedGradient_0(nativeObj); 485 486 return retVal; 487 } 488 489 490 @Override 491 protected void finalize() throws Throwable { 492 delete(nativeObj); 493 } 494 495 496 497 // C++: HOGDescriptor() 498 private static native long HOGDescriptor_0(); 499 500 // C++: HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, Size _cellSize, int _nbins, int _derivAperture = 1, double _winSigma = -1, int _histogramNormType = HOGDescriptor::L2Hys, double _L2HysThreshold = 0.2, bool _gammaCorrection = false, int _nlevels = HOGDescriptor::DEFAULT_NLEVELS, bool _signedGradient = false) 501 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); 502 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); 503 504 // C++: HOGDescriptor(String filename) 505 private static native long HOGDescriptor_3(String filename); 506 507 // C++: size_t getDescriptorSize() 508 private static native long getDescriptorSize_0(long nativeObj); 509 510 // C++: bool checkDetectorSize() 511 private static native boolean checkDetectorSize_0(long nativeObj); 512 513 // C++: double getWinSigma() 514 private static native double getWinSigma_0(long nativeObj); 515 516 // C++: void setSVMDetector(Mat _svmdetector) 517 private static native void setSVMDetector_0(long nativeObj, long _svmdetector_nativeObj); 518 519 // C++: bool load(String filename, String objname = String()) 520 private static native boolean load_0(long nativeObj, String filename, String objname); 521 private static native boolean load_1(long nativeObj, String filename); 522 523 // C++: void save(String filename, String objname = String()) 524 private static native void save_0(long nativeObj, String filename, String objname); 525 private static native void save_1(long nativeObj, String filename); 526 527 // C++: void compute(Mat img, vector_float& descriptors, Size winStride = Size(), Size padding = Size(), vector_Point locations = std::vector<Point>()) 528 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); 529 private static native void compute_1(long nativeObj, long img_nativeObj, long descriptors_mat_nativeObj); 530 531 // C++: void detect(Mat img, vector_Point& foundLocations, vector_double& weights, double hitThreshold = 0, Size winStride = Size(), Size padding = Size(), vector_Point searchLocations = std::vector<Point>()) 532 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); 533 private static native void detect_1(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long weights_mat_nativeObj); 534 535 // C++: void 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) 536 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); 537 private static native void detectMultiScale_1(long nativeObj, long img_nativeObj, long foundLocations_mat_nativeObj, long foundWeights_mat_nativeObj); 538 539 // C++: void computeGradient(Mat img, Mat& grad, Mat& angleOfs, Size paddingTL = Size(), Size paddingBR = Size()) 540 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); 541 private static native void computeGradient_1(long nativeObj, long img_nativeObj, long grad_nativeObj, long angleOfs_nativeObj); 542 543 // C++: static vector_float getDefaultPeopleDetector() 544 private static native long getDefaultPeopleDetector_0(); 545 546 // C++: static vector_float getDaimlerPeopleDetector() 547 private static native long getDaimlerPeopleDetector_0(); 548 549 // C++: Size HOGDescriptor::winSize 550 private static native double[] get_winSize_0(long nativeObj); 551 552 // C++: Size HOGDescriptor::blockSize 553 private static native double[] get_blockSize_0(long nativeObj); 554 555 // C++: Size HOGDescriptor::blockStride 556 private static native double[] get_blockStride_0(long nativeObj); 557 558 // C++: Size HOGDescriptor::cellSize 559 private static native double[] get_cellSize_0(long nativeObj); 560 561 // C++: int HOGDescriptor::nbins 562 private static native int get_nbins_0(long nativeObj); 563 564 // C++: int HOGDescriptor::derivAperture 565 private static native int get_derivAperture_0(long nativeObj); 566 567 // C++: double HOGDescriptor::winSigma 568 private static native double get_winSigma_0(long nativeObj); 569 570 // C++: int HOGDescriptor::histogramNormType 571 private static native int get_histogramNormType_0(long nativeObj); 572 573 // C++: double HOGDescriptor::L2HysThreshold 574 private static native double get_L2HysThreshold_0(long nativeObj); 575 576 // C++: bool HOGDescriptor::gammaCorrection 577 private static native boolean get_gammaCorrection_0(long nativeObj); 578 579 // C++: vector_float HOGDescriptor::svmDetector 580 private static native long get_svmDetector_0(long nativeObj); 581 582 // C++: int HOGDescriptor::nlevels 583 private static native int get_nlevels_0(long nativeObj); 584 585 // C++: bool HOGDescriptor::signedGradient 586 private static native boolean get_signedGradient_0(long nativeObj); 587 588 // native support for java finalize() 589 private static native void delete(long nativeObj); 590 591 } 592