1 2 // 3 // This file is auto-generated, please don't edit! 4 // 5 6 #define LOG_TAG "org.opencv.video" 7 8 #include "common.h" 9 10 #include "opencv2/opencv_modules.hpp" 11 #ifdef HAVE_OPENCV_VIDEO 12 13 #include <string> 14 15 #include "opencv2/video.hpp" 16 17 #include "../../video/include/opencv2/video/tracking.hpp" 18 #include "../../video/include/opencv2/video/background_segm.hpp" 19 20 using namespace cv; 21 22 /// throw java exception 23 static void throwJavaException(JNIEnv *env, const std::exception *e, const char *method) { 24 std::string what = "unknown exception"; 25 jclass je = 0; 26 27 if(e) { 28 std::string exception_type = "std::exception"; 29 30 if(dynamic_cast<const cv::Exception*>(e)) { 31 exception_type = "cv::Exception"; 32 je = env->FindClass("org/opencv/core/CvException"); 33 } 34 35 what = exception_type + ": " + e->what(); 36 } 37 38 if(!je) je = env->FindClass("java/lang/Exception"); 39 env->ThrowNew(je, what.c_str()); 40 41 LOGE("%s caught %s", method, what.c_str()); 42 (void)method; // avoid "unused" warning 43 } 44 45 46 extern "C" { 47 48 49 // 50 // native support for java finalize() 51 // static void Ptr<cv::DualTVL1OpticalFlow>::delete( __int64 self ) 52 // 53 JNIEXPORT void JNICALL Java_org_opencv_video_DualTVL1OpticalFlow_delete(JNIEnv*, jclass, jlong); 54 55 JNIEXPORT void JNICALL Java_org_opencv_video_DualTVL1OpticalFlow_delete 56 (JNIEnv*, jclass, jlong self) 57 { 58 delete (Ptr<cv::DualTVL1OpticalFlow>*) self; 59 } 60 61 62 // 63 // void calc(Mat I0, Mat I1, Mat& flow) 64 // 65 66 JNIEXPORT void JNICALL Java_org_opencv_video_DenseOpticalFlow_calc_10 (JNIEnv*, jclass, jlong, jlong, jlong, jlong); 67 68 JNIEXPORT void JNICALL Java_org_opencv_video_DenseOpticalFlow_calc_10 69 (JNIEnv* env, jclass , jlong self, jlong I0_nativeObj, jlong I1_nativeObj, jlong flow_nativeObj) 70 { 71 static const char method_name[] = "video::calc_10()"; 72 try { 73 LOGD("%s", method_name); 74 Ptr<cv::DenseOpticalFlow>* me = (Ptr<cv::DenseOpticalFlow>*) self; //TODO: check for NULL 75 Mat& I0 = *((Mat*)I0_nativeObj); 76 Mat& I1 = *((Mat*)I1_nativeObj); 77 Mat& flow = *((Mat*)flow_nativeObj); 78 (*me)->calc( I0, I1, flow ); 79 return; 80 } catch(const std::exception &e) { 81 throwJavaException(env, &e, method_name); 82 } catch (...) { 83 throwJavaException(env, 0, method_name); 84 } 85 return; 86 } 87 88 89 90 // 91 // void collectGarbage() 92 // 93 94 JNIEXPORT void JNICALL Java_org_opencv_video_DenseOpticalFlow_collectGarbage_10 (JNIEnv*, jclass, jlong); 95 96 JNIEXPORT void JNICALL Java_org_opencv_video_DenseOpticalFlow_collectGarbage_10 97 (JNIEnv* env, jclass , jlong self) 98 { 99 static const char method_name[] = "video::collectGarbage_10()"; 100 try { 101 LOGD("%s", method_name); 102 Ptr<cv::DenseOpticalFlow>* me = (Ptr<cv::DenseOpticalFlow>*) self; //TODO: check for NULL 103 (*me)->collectGarbage( ); 104 return; 105 } catch(const std::exception &e) { 106 throwJavaException(env, &e, method_name); 107 } catch (...) { 108 throwJavaException(env, 0, method_name); 109 } 110 return; 111 } 112 113 114 115 // 116 // native support for java finalize() 117 // static void Ptr<cv::DenseOpticalFlow>::delete( __int64 self ) 118 // 119 JNIEXPORT void JNICALL Java_org_opencv_video_DenseOpticalFlow_delete(JNIEnv*, jclass, jlong); 120 121 JNIEXPORT void JNICALL Java_org_opencv_video_DenseOpticalFlow_delete 122 (JNIEnv*, jclass, jlong self) 123 { 124 delete (Ptr<cv::DenseOpticalFlow>*) self; 125 } 126 127 128 // 129 // void getBackgroundImage(Mat& backgroundImage) 130 // 131 132 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractor_getBackgroundImage_10 (JNIEnv*, jclass, jlong, jlong); 133 134 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractor_getBackgroundImage_10 135 (JNIEnv* env, jclass , jlong self, jlong backgroundImage_nativeObj) 136 { 137 static const char method_name[] = "video::getBackgroundImage_10()"; 138 try { 139 LOGD("%s", method_name); 140 Ptr<cv::BackgroundSubtractor>* me = (Ptr<cv::BackgroundSubtractor>*) self; //TODO: check for NULL 141 Mat& backgroundImage = *((Mat*)backgroundImage_nativeObj); 142 (*me)->getBackgroundImage( backgroundImage ); 143 return; 144 } catch(const std::exception &e) { 145 throwJavaException(env, &e, method_name); 146 } catch (...) { 147 throwJavaException(env, 0, method_name); 148 } 149 return; 150 } 151 152 153 154 // 155 // void apply(Mat image, Mat& fgmask, double learningRate = -1) 156 // 157 158 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractor_apply_10 (JNIEnv*, jclass, jlong, jlong, jlong, jdouble); 159 160 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractor_apply_10 161 (JNIEnv* env, jclass , jlong self, jlong image_nativeObj, jlong fgmask_nativeObj, jdouble learningRate) 162 { 163 static const char method_name[] = "video::apply_10()"; 164 try { 165 LOGD("%s", method_name); 166 Ptr<cv::BackgroundSubtractor>* me = (Ptr<cv::BackgroundSubtractor>*) self; //TODO: check for NULL 167 Mat& image = *((Mat*)image_nativeObj); 168 Mat& fgmask = *((Mat*)fgmask_nativeObj); 169 (*me)->apply( image, fgmask, (double)learningRate ); 170 return; 171 } catch(const std::exception &e) { 172 throwJavaException(env, &e, method_name); 173 } catch (...) { 174 throwJavaException(env, 0, method_name); 175 } 176 return; 177 } 178 179 180 181 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractor_apply_11 (JNIEnv*, jclass, jlong, jlong, jlong); 182 183 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractor_apply_11 184 (JNIEnv* env, jclass , jlong self, jlong image_nativeObj, jlong fgmask_nativeObj) 185 { 186 static const char method_name[] = "video::apply_11()"; 187 try { 188 LOGD("%s", method_name); 189 Ptr<cv::BackgroundSubtractor>* me = (Ptr<cv::BackgroundSubtractor>*) self; //TODO: check for NULL 190 Mat& image = *((Mat*)image_nativeObj); 191 Mat& fgmask = *((Mat*)fgmask_nativeObj); 192 (*me)->apply( image, fgmask ); 193 return; 194 } catch(const std::exception &e) { 195 throwJavaException(env, &e, method_name); 196 } catch (...) { 197 throwJavaException(env, 0, method_name); 198 } 199 return; 200 } 201 202 203 204 // 205 // native support for java finalize() 206 // static void Ptr<cv::BackgroundSubtractor>::delete( __int64 self ) 207 // 208 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractor_delete(JNIEnv*, jclass, jlong); 209 210 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractor_delete 211 (JNIEnv*, jclass, jlong self) 212 { 213 delete (Ptr<cv::BackgroundSubtractor>*) self; 214 } 215 216 217 // 218 // RotatedRect CamShift(Mat probImage, Rect& window, TermCriteria criteria) 219 // 220 221 JNIEXPORT jdoubleArray JNICALL Java_org_opencv_video_Video_CamShift_10 (JNIEnv*, jclass, jlong, jint, jint, jint, jint, jdoubleArray, jint, jint, jdouble); 222 223 JNIEXPORT jdoubleArray JNICALL Java_org_opencv_video_Video_CamShift_10 224 (JNIEnv* env, jclass , jlong probImage_nativeObj, jint window_x, jint window_y, jint window_width, jint window_height, jdoubleArray window_out, jint criteria_type, jint criteria_maxCount, jdouble criteria_epsilon) 225 { 226 static const char method_name[] = "video::CamShift_10()"; 227 try { 228 LOGD("%s", method_name); 229 Mat& probImage = *((Mat*)probImage_nativeObj); 230 Rect window(window_x, window_y, window_width, window_height); 231 TermCriteria criteria(criteria_type, criteria_maxCount, criteria_epsilon); 232 RotatedRect _retval_ = cv::CamShift( probImage, window, criteria ); 233 jdoubleArray _da_retval_ = env->NewDoubleArray(5); jdouble _tmp_retval_[5] = {_retval_.center.x, _retval_.center.y, _retval_.size.width, _retval_.size.height, _retval_.angle}; env->SetDoubleArrayRegion(_da_retval_, 0, 5, _tmp_retval_); jdouble tmp_window[4] = {window.x, window.y, window.width, window.height}; env->SetDoubleArrayRegion(window_out, 0, 4, tmp_window); 234 return _da_retval_; 235 } catch(const std::exception &e) { 236 throwJavaException(env, &e, method_name); 237 } catch (...) { 238 throwJavaException(env, 0, method_name); 239 } 240 return 0; 241 } 242 243 244 245 // 246 // int meanShift(Mat probImage, Rect& window, TermCriteria criteria) 247 // 248 249 JNIEXPORT jint JNICALL Java_org_opencv_video_Video_meanShift_10 (JNIEnv*, jclass, jlong, jint, jint, jint, jint, jdoubleArray, jint, jint, jdouble); 250 251 JNIEXPORT jint JNICALL Java_org_opencv_video_Video_meanShift_10 252 (JNIEnv* env, jclass , jlong probImage_nativeObj, jint window_x, jint window_y, jint window_width, jint window_height, jdoubleArray window_out, jint criteria_type, jint criteria_maxCount, jdouble criteria_epsilon) 253 { 254 static const char method_name[] = "video::meanShift_10()"; 255 try { 256 LOGD("%s", method_name); 257 Mat& probImage = *((Mat*)probImage_nativeObj); 258 Rect window(window_x, window_y, window_width, window_height); 259 TermCriteria criteria(criteria_type, criteria_maxCount, criteria_epsilon); 260 int _retval_ = cv::meanShift( probImage, window, criteria ); 261 jdouble tmp_window[4] = {window.x, window.y, window.width, window.height}; env->SetDoubleArrayRegion(window_out, 0, 4, tmp_window); 262 return _retval_; 263 } catch(const std::exception &e) { 264 throwJavaException(env, &e, method_name); 265 } catch (...) { 266 throwJavaException(env, 0, method_name); 267 } 268 return 0; 269 } 270 271 272 273 // 274 // int buildOpticalFlowPyramid(Mat img, vector_Mat& pyramid, Size winSize, int maxLevel, bool withDerivatives = true, int pyrBorder = BORDER_REFLECT_101, int derivBorder = BORDER_CONSTANT, bool tryReuseInputImage = true) 275 // 276 277 JNIEXPORT jint JNICALL Java_org_opencv_video_Video_buildOpticalFlowPyramid_10 (JNIEnv*, jclass, jlong, jlong, jdouble, jdouble, jint, jboolean, jint, jint, jboolean); 278 279 JNIEXPORT jint JNICALL Java_org_opencv_video_Video_buildOpticalFlowPyramid_10 280 (JNIEnv* env, jclass , jlong img_nativeObj, jlong pyramid_mat_nativeObj, jdouble winSize_width, jdouble winSize_height, jint maxLevel, jboolean withDerivatives, jint pyrBorder, jint derivBorder, jboolean tryReuseInputImage) 281 { 282 static const char method_name[] = "video::buildOpticalFlowPyramid_10()"; 283 try { 284 LOGD("%s", method_name); 285 std::vector<Mat> pyramid; 286 Mat& pyramid_mat = *((Mat*)pyramid_mat_nativeObj); 287 Mat& img = *((Mat*)img_nativeObj); 288 Size winSize((int)winSize_width, (int)winSize_height); 289 int _retval_ = cv::buildOpticalFlowPyramid( img, pyramid, winSize, (int)maxLevel, (bool)withDerivatives, (int)pyrBorder, (int)derivBorder, (bool)tryReuseInputImage ); 290 vector_Mat_to_Mat( pyramid, pyramid_mat ); 291 return _retval_; 292 } catch(const std::exception &e) { 293 throwJavaException(env, &e, method_name); 294 } catch (...) { 295 throwJavaException(env, 0, method_name); 296 } 297 return 0; 298 } 299 300 301 302 JNIEXPORT jint JNICALL Java_org_opencv_video_Video_buildOpticalFlowPyramid_11 (JNIEnv*, jclass, jlong, jlong, jdouble, jdouble, jint); 303 304 JNIEXPORT jint JNICALL Java_org_opencv_video_Video_buildOpticalFlowPyramid_11 305 (JNIEnv* env, jclass , jlong img_nativeObj, jlong pyramid_mat_nativeObj, jdouble winSize_width, jdouble winSize_height, jint maxLevel) 306 { 307 static const char method_name[] = "video::buildOpticalFlowPyramid_11()"; 308 try { 309 LOGD("%s", method_name); 310 std::vector<Mat> pyramid; 311 Mat& pyramid_mat = *((Mat*)pyramid_mat_nativeObj); 312 Mat& img = *((Mat*)img_nativeObj); 313 Size winSize((int)winSize_width, (int)winSize_height); 314 int _retval_ = cv::buildOpticalFlowPyramid( img, pyramid, winSize, (int)maxLevel ); 315 vector_Mat_to_Mat( pyramid, pyramid_mat ); 316 return _retval_; 317 } catch(const std::exception &e) { 318 throwJavaException(env, &e, method_name); 319 } catch (...) { 320 throwJavaException(env, 0, method_name); 321 } 322 return 0; 323 } 324 325 326 327 // 328 // void calcOpticalFlowPyrLK(Mat prevImg, Mat nextImg, vector_Point2f prevPts, vector_Point2f& nextPts, vector_uchar& status, vector_float& err, Size winSize = Size(21,21), int maxLevel = 3, TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01), int flags = 0, double minEigThreshold = 1e-4) 329 // 330 331 JNIEXPORT void JNICALL Java_org_opencv_video_Video_calcOpticalFlowPyrLK_10 (JNIEnv*, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jdouble, jdouble, jint, jint, jint, jdouble, jint, jdouble); 332 333 JNIEXPORT void JNICALL Java_org_opencv_video_Video_calcOpticalFlowPyrLK_10 334 (JNIEnv* env, jclass , jlong prevImg_nativeObj, jlong nextImg_nativeObj, jlong prevPts_mat_nativeObj, jlong nextPts_mat_nativeObj, jlong status_mat_nativeObj, jlong err_mat_nativeObj, jdouble winSize_width, jdouble winSize_height, jint maxLevel, jint criteria_type, jint criteria_maxCount, jdouble criteria_epsilon, jint flags, jdouble minEigThreshold) 335 { 336 static const char method_name[] = "video::calcOpticalFlowPyrLK_10()"; 337 try { 338 LOGD("%s", method_name); 339 std::vector<Point2f> prevPts; 340 Mat& prevPts_mat = *((Mat*)prevPts_mat_nativeObj); 341 Mat_to_vector_Point2f( prevPts_mat, prevPts ); 342 std::vector<Point2f> nextPts; 343 Mat& nextPts_mat = *((Mat*)nextPts_mat_nativeObj); 344 Mat_to_vector_Point2f( nextPts_mat, nextPts ); 345 std::vector<uchar> status; 346 Mat& status_mat = *((Mat*)status_mat_nativeObj); 347 std::vector<float> err; 348 Mat& err_mat = *((Mat*)err_mat_nativeObj); 349 Mat& prevImg = *((Mat*)prevImg_nativeObj); 350 Mat& nextImg = *((Mat*)nextImg_nativeObj); 351 Size winSize((int)winSize_width, (int)winSize_height); 352 TermCriteria criteria(criteria_type, criteria_maxCount, criteria_epsilon); 353 cv::calcOpticalFlowPyrLK( prevImg, nextImg, prevPts, nextPts, status, err, winSize, (int)maxLevel, criteria, (int)flags, (double)minEigThreshold ); 354 vector_Point2f_to_Mat( nextPts, nextPts_mat ); vector_uchar_to_Mat( status, status_mat ); vector_float_to_Mat( err, err_mat ); 355 return; 356 } catch(const std::exception &e) { 357 throwJavaException(env, &e, method_name); 358 } catch (...) { 359 throwJavaException(env, 0, method_name); 360 } 361 return; 362 } 363 364 365 366 JNIEXPORT void JNICALL Java_org_opencv_video_Video_calcOpticalFlowPyrLK_11 (JNIEnv*, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jdouble, jdouble, jint); 367 368 JNIEXPORT void JNICALL Java_org_opencv_video_Video_calcOpticalFlowPyrLK_11 369 (JNIEnv* env, jclass , jlong prevImg_nativeObj, jlong nextImg_nativeObj, jlong prevPts_mat_nativeObj, jlong nextPts_mat_nativeObj, jlong status_mat_nativeObj, jlong err_mat_nativeObj, jdouble winSize_width, jdouble winSize_height, jint maxLevel) 370 { 371 static const char method_name[] = "video::calcOpticalFlowPyrLK_11()"; 372 try { 373 LOGD("%s", method_name); 374 std::vector<Point2f> prevPts; 375 Mat& prevPts_mat = *((Mat*)prevPts_mat_nativeObj); 376 Mat_to_vector_Point2f( prevPts_mat, prevPts ); 377 std::vector<Point2f> nextPts; 378 Mat& nextPts_mat = *((Mat*)nextPts_mat_nativeObj); 379 Mat_to_vector_Point2f( nextPts_mat, nextPts ); 380 std::vector<uchar> status; 381 Mat& status_mat = *((Mat*)status_mat_nativeObj); 382 std::vector<float> err; 383 Mat& err_mat = *((Mat*)err_mat_nativeObj); 384 Mat& prevImg = *((Mat*)prevImg_nativeObj); 385 Mat& nextImg = *((Mat*)nextImg_nativeObj); 386 Size winSize((int)winSize_width, (int)winSize_height); 387 cv::calcOpticalFlowPyrLK( prevImg, nextImg, prevPts, nextPts, status, err, winSize, (int)maxLevel ); 388 vector_Point2f_to_Mat( nextPts, nextPts_mat ); vector_uchar_to_Mat( status, status_mat ); vector_float_to_Mat( err, err_mat ); 389 return; 390 } catch(const std::exception &e) { 391 throwJavaException(env, &e, method_name); 392 } catch (...) { 393 throwJavaException(env, 0, method_name); 394 } 395 return; 396 } 397 398 399 400 JNIEXPORT void JNICALL Java_org_opencv_video_Video_calcOpticalFlowPyrLK_12 (JNIEnv*, jclass, jlong, jlong, jlong, jlong, jlong, jlong); 401 402 JNIEXPORT void JNICALL Java_org_opencv_video_Video_calcOpticalFlowPyrLK_12 403 (JNIEnv* env, jclass , jlong prevImg_nativeObj, jlong nextImg_nativeObj, jlong prevPts_mat_nativeObj, jlong nextPts_mat_nativeObj, jlong status_mat_nativeObj, jlong err_mat_nativeObj) 404 { 405 static const char method_name[] = "video::calcOpticalFlowPyrLK_12()"; 406 try { 407 LOGD("%s", method_name); 408 std::vector<Point2f> prevPts; 409 Mat& prevPts_mat = *((Mat*)prevPts_mat_nativeObj); 410 Mat_to_vector_Point2f( prevPts_mat, prevPts ); 411 std::vector<Point2f> nextPts; 412 Mat& nextPts_mat = *((Mat*)nextPts_mat_nativeObj); 413 Mat_to_vector_Point2f( nextPts_mat, nextPts ); 414 std::vector<uchar> status; 415 Mat& status_mat = *((Mat*)status_mat_nativeObj); 416 std::vector<float> err; 417 Mat& err_mat = *((Mat*)err_mat_nativeObj); 418 Mat& prevImg = *((Mat*)prevImg_nativeObj); 419 Mat& nextImg = *((Mat*)nextImg_nativeObj); 420 cv::calcOpticalFlowPyrLK( prevImg, nextImg, prevPts, nextPts, status, err ); 421 vector_Point2f_to_Mat( nextPts, nextPts_mat ); vector_uchar_to_Mat( status, status_mat ); vector_float_to_Mat( err, err_mat ); 422 return; 423 } catch(const std::exception &e) { 424 throwJavaException(env, &e, method_name); 425 } catch (...) { 426 throwJavaException(env, 0, method_name); 427 } 428 return; 429 } 430 431 432 433 // 434 // void calcOpticalFlowFarneback(Mat prev, Mat next, Mat& flow, double pyr_scale, int levels, int winsize, int iterations, int poly_n, double poly_sigma, int flags) 435 // 436 437 JNIEXPORT void JNICALL Java_org_opencv_video_Video_calcOpticalFlowFarneback_10 (JNIEnv*, jclass, jlong, jlong, jlong, jdouble, jint, jint, jint, jint, jdouble, jint); 438 439 JNIEXPORT void JNICALL Java_org_opencv_video_Video_calcOpticalFlowFarneback_10 440 (JNIEnv* env, jclass , jlong prev_nativeObj, jlong next_nativeObj, jlong flow_nativeObj, jdouble pyr_scale, jint levels, jint winsize, jint iterations, jint poly_n, jdouble poly_sigma, jint flags) 441 { 442 static const char method_name[] = "video::calcOpticalFlowFarneback_10()"; 443 try { 444 LOGD("%s", method_name); 445 Mat& prev = *((Mat*)prev_nativeObj); 446 Mat& next = *((Mat*)next_nativeObj); 447 Mat& flow = *((Mat*)flow_nativeObj); 448 cv::calcOpticalFlowFarneback( prev, next, flow, (double)pyr_scale, (int)levels, (int)winsize, (int)iterations, (int)poly_n, (double)poly_sigma, (int)flags ); 449 return; 450 } catch(const std::exception &e) { 451 throwJavaException(env, &e, method_name); 452 } catch (...) { 453 throwJavaException(env, 0, method_name); 454 } 455 return; 456 } 457 458 459 460 // 461 // Mat estimateRigidTransform(Mat src, Mat dst, bool fullAffine) 462 // 463 464 JNIEXPORT jlong JNICALL Java_org_opencv_video_Video_estimateRigidTransform_10 (JNIEnv*, jclass, jlong, jlong, jboolean); 465 466 JNIEXPORT jlong JNICALL Java_org_opencv_video_Video_estimateRigidTransform_10 467 (JNIEnv* env, jclass , jlong src_nativeObj, jlong dst_nativeObj, jboolean fullAffine) 468 { 469 static const char method_name[] = "video::estimateRigidTransform_10()"; 470 try { 471 LOGD("%s", method_name); 472 Mat& src = *((Mat*)src_nativeObj); 473 Mat& dst = *((Mat*)dst_nativeObj); 474 ::Mat _retval_ = cv::estimateRigidTransform( src, dst, (bool)fullAffine ); 475 return (jlong) new ::Mat(_retval_); 476 } catch(const std::exception &e) { 477 throwJavaException(env, &e, method_name); 478 } catch (...) { 479 throwJavaException(env, 0, method_name); 480 } 481 return 0; 482 } 483 484 485 486 // 487 // double findTransformECC(Mat templateImage, Mat inputImage, Mat& warpMatrix, int motionType = MOTION_AFFINE, TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 50, 0.001), Mat inputMask = Mat()) 488 // 489 490 JNIEXPORT jdouble JNICALL Java_org_opencv_video_Video_findTransformECC_10 (JNIEnv*, jclass, jlong, jlong, jlong, jint, jint, jint, jdouble, jlong); 491 492 JNIEXPORT jdouble JNICALL Java_org_opencv_video_Video_findTransformECC_10 493 (JNIEnv* env, jclass , jlong templateImage_nativeObj, jlong inputImage_nativeObj, jlong warpMatrix_nativeObj, jint motionType, jint criteria_type, jint criteria_maxCount, jdouble criteria_epsilon, jlong inputMask_nativeObj) 494 { 495 static const char method_name[] = "video::findTransformECC_10()"; 496 try { 497 LOGD("%s", method_name); 498 Mat& templateImage = *((Mat*)templateImage_nativeObj); 499 Mat& inputImage = *((Mat*)inputImage_nativeObj); 500 Mat& warpMatrix = *((Mat*)warpMatrix_nativeObj); 501 TermCriteria criteria(criteria_type, criteria_maxCount, criteria_epsilon); 502 Mat& inputMask = *((Mat*)inputMask_nativeObj); 503 double _retval_ = cv::findTransformECC( templateImage, inputImage, warpMatrix, (int)motionType, criteria, inputMask ); 504 return _retval_; 505 } catch(const std::exception &e) { 506 throwJavaException(env, &e, method_name); 507 } catch (...) { 508 throwJavaException(env, 0, method_name); 509 } 510 return 0; 511 } 512 513 514 515 JNIEXPORT jdouble JNICALL Java_org_opencv_video_Video_findTransformECC_11 (JNIEnv*, jclass, jlong, jlong, jlong, jint); 516 517 JNIEXPORT jdouble JNICALL Java_org_opencv_video_Video_findTransformECC_11 518 (JNIEnv* env, jclass , jlong templateImage_nativeObj, jlong inputImage_nativeObj, jlong warpMatrix_nativeObj, jint motionType) 519 { 520 static const char method_name[] = "video::findTransformECC_11()"; 521 try { 522 LOGD("%s", method_name); 523 Mat& templateImage = *((Mat*)templateImage_nativeObj); 524 Mat& inputImage = *((Mat*)inputImage_nativeObj); 525 Mat& warpMatrix = *((Mat*)warpMatrix_nativeObj); 526 double _retval_ = cv::findTransformECC( templateImage, inputImage, warpMatrix, (int)motionType ); 527 return _retval_; 528 } catch(const std::exception &e) { 529 throwJavaException(env, &e, method_name); 530 } catch (...) { 531 throwJavaException(env, 0, method_name); 532 } 533 return 0; 534 } 535 536 537 538 JNIEXPORT jdouble JNICALL Java_org_opencv_video_Video_findTransformECC_12 (JNIEnv*, jclass, jlong, jlong, jlong); 539 540 JNIEXPORT jdouble JNICALL Java_org_opencv_video_Video_findTransformECC_12 541 (JNIEnv* env, jclass , jlong templateImage_nativeObj, jlong inputImage_nativeObj, jlong warpMatrix_nativeObj) 542 { 543 static const char method_name[] = "video::findTransformECC_12()"; 544 try { 545 LOGD("%s", method_name); 546 Mat& templateImage = *((Mat*)templateImage_nativeObj); 547 Mat& inputImage = *((Mat*)inputImage_nativeObj); 548 Mat& warpMatrix = *((Mat*)warpMatrix_nativeObj); 549 double _retval_ = cv::findTransformECC( templateImage, inputImage, warpMatrix ); 550 return _retval_; 551 } catch(const std::exception &e) { 552 throwJavaException(env, &e, method_name); 553 } catch (...) { 554 throwJavaException(env, 0, method_name); 555 } 556 return 0; 557 } 558 559 560 561 // 562 // Ptr_BackgroundSubtractorMOG2 createBackgroundSubtractorMOG2(int history = 500, double varThreshold = 16, bool detectShadows = true) 563 // 564 565 JNIEXPORT jlong JNICALL Java_org_opencv_video_Video_createBackgroundSubtractorMOG2_10 (JNIEnv*, jclass, jint, jdouble, jboolean); 566 567 JNIEXPORT jlong JNICALL Java_org_opencv_video_Video_createBackgroundSubtractorMOG2_10 568 (JNIEnv* env, jclass , jint history, jdouble varThreshold, jboolean detectShadows) 569 { 570 static const char method_name[] = "video::createBackgroundSubtractorMOG2_10()"; 571 try { 572 LOGD("%s", method_name); 573 typedef Ptr<cv::BackgroundSubtractorMOG2> Ptr_BackgroundSubtractorMOG2; 574 Ptr_BackgroundSubtractorMOG2 _retval_ = cv::createBackgroundSubtractorMOG2( (int)history, (double)varThreshold, (bool)detectShadows ); 575 return (jlong)(new Ptr_BackgroundSubtractorMOG2(_retval_)); 576 } catch(const std::exception &e) { 577 throwJavaException(env, &e, method_name); 578 } catch (...) { 579 throwJavaException(env, 0, method_name); 580 } 581 return 0; 582 } 583 584 585 586 JNIEXPORT jlong JNICALL Java_org_opencv_video_Video_createBackgroundSubtractorMOG2_11 (JNIEnv*, jclass); 587 588 JNIEXPORT jlong JNICALL Java_org_opencv_video_Video_createBackgroundSubtractorMOG2_11 589 (JNIEnv* env, jclass ) 590 { 591 static const char method_name[] = "video::createBackgroundSubtractorMOG2_11()"; 592 try { 593 LOGD("%s", method_name); 594 typedef Ptr<cv::BackgroundSubtractorMOG2> Ptr_BackgroundSubtractorMOG2; 595 Ptr_BackgroundSubtractorMOG2 _retval_ = cv::createBackgroundSubtractorMOG2( ); 596 return (jlong)(new Ptr_BackgroundSubtractorMOG2(_retval_)); 597 } catch(const std::exception &e) { 598 throwJavaException(env, &e, method_name); 599 } catch (...) { 600 throwJavaException(env, 0, method_name); 601 } 602 return 0; 603 } 604 605 606 607 // 608 // Ptr_DualTVL1OpticalFlow createOptFlow_DualTVL1() 609 // 610 611 JNIEXPORT jlong JNICALL Java_org_opencv_video_Video_createOptFlow_1DualTVL1_10 (JNIEnv*, jclass); 612 613 JNIEXPORT jlong JNICALL Java_org_opencv_video_Video_createOptFlow_1DualTVL1_10 614 (JNIEnv* env, jclass ) 615 { 616 static const char method_name[] = "video::createOptFlow_1DualTVL1_10()"; 617 try { 618 LOGD("%s", method_name); 619 typedef Ptr<cv::DualTVL1OpticalFlow> Ptr_DualTVL1OpticalFlow; 620 Ptr_DualTVL1OpticalFlow _retval_ = cv::createOptFlow_DualTVL1( ); 621 return (jlong)(new Ptr_DualTVL1OpticalFlow(_retval_)); 622 } catch(const std::exception &e) { 623 throwJavaException(env, &e, method_name); 624 } catch (...) { 625 throwJavaException(env, 0, method_name); 626 } 627 return 0; 628 } 629 630 631 632 // 633 // Ptr_BackgroundSubtractorKNN createBackgroundSubtractorKNN(int history = 500, double dist2Threshold = 400.0, bool detectShadows = true) 634 // 635 636 JNIEXPORT jlong JNICALL Java_org_opencv_video_Video_createBackgroundSubtractorKNN_10 (JNIEnv*, jclass, jint, jdouble, jboolean); 637 638 JNIEXPORT jlong JNICALL Java_org_opencv_video_Video_createBackgroundSubtractorKNN_10 639 (JNIEnv* env, jclass , jint history, jdouble dist2Threshold, jboolean detectShadows) 640 { 641 static const char method_name[] = "video::createBackgroundSubtractorKNN_10()"; 642 try { 643 LOGD("%s", method_name); 644 typedef Ptr<cv::BackgroundSubtractorKNN> Ptr_BackgroundSubtractorKNN; 645 Ptr_BackgroundSubtractorKNN _retval_ = cv::createBackgroundSubtractorKNN( (int)history, (double)dist2Threshold, (bool)detectShadows ); 646 return (jlong)(new Ptr_BackgroundSubtractorKNN(_retval_)); 647 } catch(const std::exception &e) { 648 throwJavaException(env, &e, method_name); 649 } catch (...) { 650 throwJavaException(env, 0, method_name); 651 } 652 return 0; 653 } 654 655 656 657 JNIEXPORT jlong JNICALL Java_org_opencv_video_Video_createBackgroundSubtractorKNN_11 (JNIEnv*, jclass); 658 659 JNIEXPORT jlong JNICALL Java_org_opencv_video_Video_createBackgroundSubtractorKNN_11 660 (JNIEnv* env, jclass ) 661 { 662 static const char method_name[] = "video::createBackgroundSubtractorKNN_11()"; 663 try { 664 LOGD("%s", method_name); 665 typedef Ptr<cv::BackgroundSubtractorKNN> Ptr_BackgroundSubtractorKNN; 666 Ptr_BackgroundSubtractorKNN _retval_ = cv::createBackgroundSubtractorKNN( ); 667 return (jlong)(new Ptr_BackgroundSubtractorKNN(_retval_)); 668 } catch(const std::exception &e) { 669 throwJavaException(env, &e, method_name); 670 } catch (...) { 671 throwJavaException(env, 0, method_name); 672 } 673 return 0; 674 } 675 676 677 678 // 679 // KalmanFilter() 680 // 681 682 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_KalmanFilter_10 (JNIEnv*, jclass); 683 684 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_KalmanFilter_10 685 (JNIEnv* env, jclass ) 686 { 687 static const char method_name[] = "video::KalmanFilter_10()"; 688 try { 689 LOGD("%s", method_name); 690 691 cv::KalmanFilter* _retval_ = new cv::KalmanFilter( ); 692 return (jlong) _retval_; 693 } catch(const std::exception &e) { 694 throwJavaException(env, &e, method_name); 695 } catch (...) { 696 throwJavaException(env, 0, method_name); 697 } 698 return 0; 699 } 700 701 702 703 // 704 // KalmanFilter(int dynamParams, int measureParams, int controlParams = 0, int type = CV_32F) 705 // 706 707 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_KalmanFilter_11 (JNIEnv*, jclass, jint, jint, jint, jint); 708 709 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_KalmanFilter_11 710 (JNIEnv* env, jclass , jint dynamParams, jint measureParams, jint controlParams, jint type) 711 { 712 static const char method_name[] = "video::KalmanFilter_11()"; 713 try { 714 LOGD("%s", method_name); 715 716 cv::KalmanFilter* _retval_ = new cv::KalmanFilter( (int)dynamParams, (int)measureParams, (int)controlParams, (int)type ); 717 return (jlong) _retval_; 718 } catch(const std::exception &e) { 719 throwJavaException(env, &e, method_name); 720 } catch (...) { 721 throwJavaException(env, 0, method_name); 722 } 723 return 0; 724 } 725 726 727 728 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_KalmanFilter_12 (JNIEnv*, jclass, jint, jint); 729 730 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_KalmanFilter_12 731 (JNIEnv* env, jclass , jint dynamParams, jint measureParams) 732 { 733 static const char method_name[] = "video::KalmanFilter_12()"; 734 try { 735 LOGD("%s", method_name); 736 737 cv::KalmanFilter* _retval_ = new cv::KalmanFilter( (int)dynamParams, (int)measureParams ); 738 return (jlong) _retval_; 739 } catch(const std::exception &e) { 740 throwJavaException(env, &e, method_name); 741 } catch (...) { 742 throwJavaException(env, 0, method_name); 743 } 744 return 0; 745 } 746 747 748 749 // 750 // Mat predict(Mat control = Mat()) 751 // 752 753 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_predict_10 (JNIEnv*, jclass, jlong, jlong); 754 755 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_predict_10 756 (JNIEnv* env, jclass , jlong self, jlong control_nativeObj) 757 { 758 static const char method_name[] = "video::predict_10()"; 759 try { 760 LOGD("%s", method_name); 761 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 762 Mat& control = *((Mat*)control_nativeObj); 763 ::Mat _retval_ = me->predict( control ); 764 return (jlong) new ::Mat(_retval_); 765 } catch(const std::exception &e) { 766 throwJavaException(env, &e, method_name); 767 } catch (...) { 768 throwJavaException(env, 0, method_name); 769 } 770 return 0; 771 } 772 773 774 775 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_predict_11 (JNIEnv*, jclass, jlong); 776 777 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_predict_11 778 (JNIEnv* env, jclass , jlong self) 779 { 780 static const char method_name[] = "video::predict_11()"; 781 try { 782 LOGD("%s", method_name); 783 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 784 ::Mat _retval_ = me->predict( ); 785 return (jlong) new ::Mat(_retval_); 786 } catch(const std::exception &e) { 787 throwJavaException(env, &e, method_name); 788 } catch (...) { 789 throwJavaException(env, 0, method_name); 790 } 791 return 0; 792 } 793 794 795 796 // 797 // Mat correct(Mat measurement) 798 // 799 800 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_correct_10 (JNIEnv*, jclass, jlong, jlong); 801 802 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_correct_10 803 (JNIEnv* env, jclass , jlong self, jlong measurement_nativeObj) 804 { 805 static const char method_name[] = "video::correct_10()"; 806 try { 807 LOGD("%s", method_name); 808 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 809 Mat& measurement = *((Mat*)measurement_nativeObj); 810 ::Mat _retval_ = me->correct( measurement ); 811 return (jlong) new ::Mat(_retval_); 812 } catch(const std::exception &e) { 813 throwJavaException(env, &e, method_name); 814 } catch (...) { 815 throwJavaException(env, 0, method_name); 816 } 817 return 0; 818 } 819 820 821 822 // 823 // Mat KalmanFilter::statePre 824 // 825 826 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1statePre_10 (JNIEnv*, jclass, jlong); 827 828 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1statePre_10 829 (JNIEnv* env, jclass , jlong self) 830 { 831 static const char method_name[] = "video::get_1statePre_10()"; 832 try { 833 LOGD("%s", method_name); 834 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 835 ::Mat _retval_ = me->statePre;//( ); 836 return (jlong) new ::Mat(_retval_); 837 } catch(const std::exception &e) { 838 throwJavaException(env, &e, method_name); 839 } catch (...) { 840 throwJavaException(env, 0, method_name); 841 } 842 return 0; 843 } 844 845 846 847 // 848 // void KalmanFilter::statePre 849 // 850 851 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1statePre_10 (JNIEnv*, jclass, jlong, jlong); 852 853 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1statePre_10 854 (JNIEnv* env, jclass , jlong self, jlong statePre_nativeObj) 855 { 856 static const char method_name[] = "video::set_1statePre_10()"; 857 try { 858 LOGD("%s", method_name); 859 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 860 Mat& statePre = *((Mat*)statePre_nativeObj); 861 me->statePre = ( statePre ); 862 return; 863 } catch(const std::exception &e) { 864 throwJavaException(env, &e, method_name); 865 } catch (...) { 866 throwJavaException(env, 0, method_name); 867 } 868 return; 869 } 870 871 872 873 // 874 // Mat KalmanFilter::statePost 875 // 876 877 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1statePost_10 (JNIEnv*, jclass, jlong); 878 879 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1statePost_10 880 (JNIEnv* env, jclass , jlong self) 881 { 882 static const char method_name[] = "video::get_1statePost_10()"; 883 try { 884 LOGD("%s", method_name); 885 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 886 ::Mat _retval_ = me->statePost;//( ); 887 return (jlong) new ::Mat(_retval_); 888 } catch(const std::exception &e) { 889 throwJavaException(env, &e, method_name); 890 } catch (...) { 891 throwJavaException(env, 0, method_name); 892 } 893 return 0; 894 } 895 896 897 898 // 899 // void KalmanFilter::statePost 900 // 901 902 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1statePost_10 (JNIEnv*, jclass, jlong, jlong); 903 904 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1statePost_10 905 (JNIEnv* env, jclass , jlong self, jlong statePost_nativeObj) 906 { 907 static const char method_name[] = "video::set_1statePost_10()"; 908 try { 909 LOGD("%s", method_name); 910 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 911 Mat& statePost = *((Mat*)statePost_nativeObj); 912 me->statePost = ( statePost ); 913 return; 914 } catch(const std::exception &e) { 915 throwJavaException(env, &e, method_name); 916 } catch (...) { 917 throwJavaException(env, 0, method_name); 918 } 919 return; 920 } 921 922 923 924 // 925 // Mat KalmanFilter::transitionMatrix 926 // 927 928 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1transitionMatrix_10 (JNIEnv*, jclass, jlong); 929 930 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1transitionMatrix_10 931 (JNIEnv* env, jclass , jlong self) 932 { 933 static const char method_name[] = "video::get_1transitionMatrix_10()"; 934 try { 935 LOGD("%s", method_name); 936 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 937 ::Mat _retval_ = me->transitionMatrix;//( ); 938 return (jlong) new ::Mat(_retval_); 939 } catch(const std::exception &e) { 940 throwJavaException(env, &e, method_name); 941 } catch (...) { 942 throwJavaException(env, 0, method_name); 943 } 944 return 0; 945 } 946 947 948 949 // 950 // void KalmanFilter::transitionMatrix 951 // 952 953 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1transitionMatrix_10 (JNIEnv*, jclass, jlong, jlong); 954 955 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1transitionMatrix_10 956 (JNIEnv* env, jclass , jlong self, jlong transitionMatrix_nativeObj) 957 { 958 static const char method_name[] = "video::set_1transitionMatrix_10()"; 959 try { 960 LOGD("%s", method_name); 961 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 962 Mat& transitionMatrix = *((Mat*)transitionMatrix_nativeObj); 963 me->transitionMatrix = ( transitionMatrix ); 964 return; 965 } catch(const std::exception &e) { 966 throwJavaException(env, &e, method_name); 967 } catch (...) { 968 throwJavaException(env, 0, method_name); 969 } 970 return; 971 } 972 973 974 975 // 976 // Mat KalmanFilter::controlMatrix 977 // 978 979 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1controlMatrix_10 (JNIEnv*, jclass, jlong); 980 981 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1controlMatrix_10 982 (JNIEnv* env, jclass , jlong self) 983 { 984 static const char method_name[] = "video::get_1controlMatrix_10()"; 985 try { 986 LOGD("%s", method_name); 987 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 988 ::Mat _retval_ = me->controlMatrix;//( ); 989 return (jlong) new ::Mat(_retval_); 990 } catch(const std::exception &e) { 991 throwJavaException(env, &e, method_name); 992 } catch (...) { 993 throwJavaException(env, 0, method_name); 994 } 995 return 0; 996 } 997 998 999 1000 // 1001 // void KalmanFilter::controlMatrix 1002 // 1003 1004 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1controlMatrix_10 (JNIEnv*, jclass, jlong, jlong); 1005 1006 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1controlMatrix_10 1007 (JNIEnv* env, jclass , jlong self, jlong controlMatrix_nativeObj) 1008 { 1009 static const char method_name[] = "video::set_1controlMatrix_10()"; 1010 try { 1011 LOGD("%s", method_name); 1012 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 1013 Mat& controlMatrix = *((Mat*)controlMatrix_nativeObj); 1014 me->controlMatrix = ( controlMatrix ); 1015 return; 1016 } catch(const std::exception &e) { 1017 throwJavaException(env, &e, method_name); 1018 } catch (...) { 1019 throwJavaException(env, 0, method_name); 1020 } 1021 return; 1022 } 1023 1024 1025 1026 // 1027 // Mat KalmanFilter::measurementMatrix 1028 // 1029 1030 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1measurementMatrix_10 (JNIEnv*, jclass, jlong); 1031 1032 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1measurementMatrix_10 1033 (JNIEnv* env, jclass , jlong self) 1034 { 1035 static const char method_name[] = "video::get_1measurementMatrix_10()"; 1036 try { 1037 LOGD("%s", method_name); 1038 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 1039 ::Mat _retval_ = me->measurementMatrix;//( ); 1040 return (jlong) new ::Mat(_retval_); 1041 } catch(const std::exception &e) { 1042 throwJavaException(env, &e, method_name); 1043 } catch (...) { 1044 throwJavaException(env, 0, method_name); 1045 } 1046 return 0; 1047 } 1048 1049 1050 1051 // 1052 // void KalmanFilter::measurementMatrix 1053 // 1054 1055 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1measurementMatrix_10 (JNIEnv*, jclass, jlong, jlong); 1056 1057 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1measurementMatrix_10 1058 (JNIEnv* env, jclass , jlong self, jlong measurementMatrix_nativeObj) 1059 { 1060 static const char method_name[] = "video::set_1measurementMatrix_10()"; 1061 try { 1062 LOGD("%s", method_name); 1063 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 1064 Mat& measurementMatrix = *((Mat*)measurementMatrix_nativeObj); 1065 me->measurementMatrix = ( measurementMatrix ); 1066 return; 1067 } catch(const std::exception &e) { 1068 throwJavaException(env, &e, method_name); 1069 } catch (...) { 1070 throwJavaException(env, 0, method_name); 1071 } 1072 return; 1073 } 1074 1075 1076 1077 // 1078 // Mat KalmanFilter::processNoiseCov 1079 // 1080 1081 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1processNoiseCov_10 (JNIEnv*, jclass, jlong); 1082 1083 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1processNoiseCov_10 1084 (JNIEnv* env, jclass , jlong self) 1085 { 1086 static const char method_name[] = "video::get_1processNoiseCov_10()"; 1087 try { 1088 LOGD("%s", method_name); 1089 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 1090 ::Mat _retval_ = me->processNoiseCov;//( ); 1091 return (jlong) new ::Mat(_retval_); 1092 } catch(const std::exception &e) { 1093 throwJavaException(env, &e, method_name); 1094 } catch (...) { 1095 throwJavaException(env, 0, method_name); 1096 } 1097 return 0; 1098 } 1099 1100 1101 1102 // 1103 // void KalmanFilter::processNoiseCov 1104 // 1105 1106 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1processNoiseCov_10 (JNIEnv*, jclass, jlong, jlong); 1107 1108 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1processNoiseCov_10 1109 (JNIEnv* env, jclass , jlong self, jlong processNoiseCov_nativeObj) 1110 { 1111 static const char method_name[] = "video::set_1processNoiseCov_10()"; 1112 try { 1113 LOGD("%s", method_name); 1114 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 1115 Mat& processNoiseCov = *((Mat*)processNoiseCov_nativeObj); 1116 me->processNoiseCov = ( processNoiseCov ); 1117 return; 1118 } catch(const std::exception &e) { 1119 throwJavaException(env, &e, method_name); 1120 } catch (...) { 1121 throwJavaException(env, 0, method_name); 1122 } 1123 return; 1124 } 1125 1126 1127 1128 // 1129 // Mat KalmanFilter::measurementNoiseCov 1130 // 1131 1132 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1measurementNoiseCov_10 (JNIEnv*, jclass, jlong); 1133 1134 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1measurementNoiseCov_10 1135 (JNIEnv* env, jclass , jlong self) 1136 { 1137 static const char method_name[] = "video::get_1measurementNoiseCov_10()"; 1138 try { 1139 LOGD("%s", method_name); 1140 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 1141 ::Mat _retval_ = me->measurementNoiseCov;//( ); 1142 return (jlong) new ::Mat(_retval_); 1143 } catch(const std::exception &e) { 1144 throwJavaException(env, &e, method_name); 1145 } catch (...) { 1146 throwJavaException(env, 0, method_name); 1147 } 1148 return 0; 1149 } 1150 1151 1152 1153 // 1154 // void KalmanFilter::measurementNoiseCov 1155 // 1156 1157 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1measurementNoiseCov_10 (JNIEnv*, jclass, jlong, jlong); 1158 1159 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1measurementNoiseCov_10 1160 (JNIEnv* env, jclass , jlong self, jlong measurementNoiseCov_nativeObj) 1161 { 1162 static const char method_name[] = "video::set_1measurementNoiseCov_10()"; 1163 try { 1164 LOGD("%s", method_name); 1165 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 1166 Mat& measurementNoiseCov = *((Mat*)measurementNoiseCov_nativeObj); 1167 me->measurementNoiseCov = ( measurementNoiseCov ); 1168 return; 1169 } catch(const std::exception &e) { 1170 throwJavaException(env, &e, method_name); 1171 } catch (...) { 1172 throwJavaException(env, 0, method_name); 1173 } 1174 return; 1175 } 1176 1177 1178 1179 // 1180 // Mat KalmanFilter::errorCovPre 1181 // 1182 1183 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1errorCovPre_10 (JNIEnv*, jclass, jlong); 1184 1185 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1errorCovPre_10 1186 (JNIEnv* env, jclass , jlong self) 1187 { 1188 static const char method_name[] = "video::get_1errorCovPre_10()"; 1189 try { 1190 LOGD("%s", method_name); 1191 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 1192 ::Mat _retval_ = me->errorCovPre;//( ); 1193 return (jlong) new ::Mat(_retval_); 1194 } catch(const std::exception &e) { 1195 throwJavaException(env, &e, method_name); 1196 } catch (...) { 1197 throwJavaException(env, 0, method_name); 1198 } 1199 return 0; 1200 } 1201 1202 1203 1204 // 1205 // void KalmanFilter::errorCovPre 1206 // 1207 1208 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1errorCovPre_10 (JNIEnv*, jclass, jlong, jlong); 1209 1210 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1errorCovPre_10 1211 (JNIEnv* env, jclass , jlong self, jlong errorCovPre_nativeObj) 1212 { 1213 static const char method_name[] = "video::set_1errorCovPre_10()"; 1214 try { 1215 LOGD("%s", method_name); 1216 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 1217 Mat& errorCovPre = *((Mat*)errorCovPre_nativeObj); 1218 me->errorCovPre = ( errorCovPre ); 1219 return; 1220 } catch(const std::exception &e) { 1221 throwJavaException(env, &e, method_name); 1222 } catch (...) { 1223 throwJavaException(env, 0, method_name); 1224 } 1225 return; 1226 } 1227 1228 1229 1230 // 1231 // Mat KalmanFilter::gain 1232 // 1233 1234 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1gain_10 (JNIEnv*, jclass, jlong); 1235 1236 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1gain_10 1237 (JNIEnv* env, jclass , jlong self) 1238 { 1239 static const char method_name[] = "video::get_1gain_10()"; 1240 try { 1241 LOGD("%s", method_name); 1242 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 1243 ::Mat _retval_ = me->gain;//( ); 1244 return (jlong) new ::Mat(_retval_); 1245 } catch(const std::exception &e) { 1246 throwJavaException(env, &e, method_name); 1247 } catch (...) { 1248 throwJavaException(env, 0, method_name); 1249 } 1250 return 0; 1251 } 1252 1253 1254 1255 // 1256 // void KalmanFilter::gain 1257 // 1258 1259 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1gain_10 (JNIEnv*, jclass, jlong, jlong); 1260 1261 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1gain_10 1262 (JNIEnv* env, jclass , jlong self, jlong gain_nativeObj) 1263 { 1264 static const char method_name[] = "video::set_1gain_10()"; 1265 try { 1266 LOGD("%s", method_name); 1267 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 1268 Mat& gain = *((Mat*)gain_nativeObj); 1269 me->gain = ( gain ); 1270 return; 1271 } catch(const std::exception &e) { 1272 throwJavaException(env, &e, method_name); 1273 } catch (...) { 1274 throwJavaException(env, 0, method_name); 1275 } 1276 return; 1277 } 1278 1279 1280 1281 // 1282 // Mat KalmanFilter::errorCovPost 1283 // 1284 1285 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1errorCovPost_10 (JNIEnv*, jclass, jlong); 1286 1287 JNIEXPORT jlong JNICALL Java_org_opencv_video_KalmanFilter_get_1errorCovPost_10 1288 (JNIEnv* env, jclass , jlong self) 1289 { 1290 static const char method_name[] = "video::get_1errorCovPost_10()"; 1291 try { 1292 LOGD("%s", method_name); 1293 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 1294 ::Mat _retval_ = me->errorCovPost;//( ); 1295 return (jlong) new ::Mat(_retval_); 1296 } catch(const std::exception &e) { 1297 throwJavaException(env, &e, method_name); 1298 } catch (...) { 1299 throwJavaException(env, 0, method_name); 1300 } 1301 return 0; 1302 } 1303 1304 1305 1306 // 1307 // void KalmanFilter::errorCovPost 1308 // 1309 1310 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1errorCovPost_10 (JNIEnv*, jclass, jlong, jlong); 1311 1312 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_set_1errorCovPost_10 1313 (JNIEnv* env, jclass , jlong self, jlong errorCovPost_nativeObj) 1314 { 1315 static const char method_name[] = "video::set_1errorCovPost_10()"; 1316 try { 1317 LOGD("%s", method_name); 1318 cv::KalmanFilter* me = (cv::KalmanFilter*) self; //TODO: check for NULL 1319 Mat& errorCovPost = *((Mat*)errorCovPost_nativeObj); 1320 me->errorCovPost = ( errorCovPost ); 1321 return; 1322 } catch(const std::exception &e) { 1323 throwJavaException(env, &e, method_name); 1324 } catch (...) { 1325 throwJavaException(env, 0, method_name); 1326 } 1327 return; 1328 } 1329 1330 1331 1332 // 1333 // native support for java finalize() 1334 // static void cv::KalmanFilter::delete( __int64 self ) 1335 // 1336 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_delete(JNIEnv*, jclass, jlong); 1337 1338 JNIEXPORT void JNICALL Java_org_opencv_video_KalmanFilter_delete 1339 (JNIEnv*, jclass, jlong self) 1340 { 1341 delete (cv::KalmanFilter*) self; 1342 } 1343 1344 1345 // 1346 // double getVarThreshold() 1347 // 1348 1349 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getVarThreshold_10 (JNIEnv*, jclass, jlong); 1350 1351 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getVarThreshold_10 1352 (JNIEnv* env, jclass , jlong self) 1353 { 1354 static const char method_name[] = "video::getVarThreshold_10()"; 1355 try { 1356 LOGD("%s", method_name); 1357 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1358 double _retval_ = (*me)->getVarThreshold( ); 1359 return _retval_; 1360 } catch(const std::exception &e) { 1361 throwJavaException(env, &e, method_name); 1362 } catch (...) { 1363 throwJavaException(env, 0, method_name); 1364 } 1365 return 0; 1366 } 1367 1368 1369 1370 // 1371 // void setVarThreshold(double varThreshold) 1372 // 1373 1374 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setVarThreshold_10 (JNIEnv*, jclass, jlong, jdouble); 1375 1376 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setVarThreshold_10 1377 (JNIEnv* env, jclass , jlong self, jdouble varThreshold) 1378 { 1379 static const char method_name[] = "video::setVarThreshold_10()"; 1380 try { 1381 LOGD("%s", method_name); 1382 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1383 (*me)->setVarThreshold( (double)varThreshold ); 1384 return; 1385 } catch(const std::exception &e) { 1386 throwJavaException(env, &e, method_name); 1387 } catch (...) { 1388 throwJavaException(env, 0, method_name); 1389 } 1390 return; 1391 } 1392 1393 1394 1395 // 1396 // double getVarThresholdGen() 1397 // 1398 1399 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getVarThresholdGen_10 (JNIEnv*, jclass, jlong); 1400 1401 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getVarThresholdGen_10 1402 (JNIEnv* env, jclass , jlong self) 1403 { 1404 static const char method_name[] = "video::getVarThresholdGen_10()"; 1405 try { 1406 LOGD("%s", method_name); 1407 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1408 double _retval_ = (*me)->getVarThresholdGen( ); 1409 return _retval_; 1410 } catch(const std::exception &e) { 1411 throwJavaException(env, &e, method_name); 1412 } catch (...) { 1413 throwJavaException(env, 0, method_name); 1414 } 1415 return 0; 1416 } 1417 1418 1419 1420 // 1421 // void setVarThresholdGen(double varThresholdGen) 1422 // 1423 1424 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setVarThresholdGen_10 (JNIEnv*, jclass, jlong, jdouble); 1425 1426 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setVarThresholdGen_10 1427 (JNIEnv* env, jclass , jlong self, jdouble varThresholdGen) 1428 { 1429 static const char method_name[] = "video::setVarThresholdGen_10()"; 1430 try { 1431 LOGD("%s", method_name); 1432 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1433 (*me)->setVarThresholdGen( (double)varThresholdGen ); 1434 return; 1435 } catch(const std::exception &e) { 1436 throwJavaException(env, &e, method_name); 1437 } catch (...) { 1438 throwJavaException(env, 0, method_name); 1439 } 1440 return; 1441 } 1442 1443 1444 1445 // 1446 // double getVarInit() 1447 // 1448 1449 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getVarInit_10 (JNIEnv*, jclass, jlong); 1450 1451 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getVarInit_10 1452 (JNIEnv* env, jclass , jlong self) 1453 { 1454 static const char method_name[] = "video::getVarInit_10()"; 1455 try { 1456 LOGD("%s", method_name); 1457 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1458 double _retval_ = (*me)->getVarInit( ); 1459 return _retval_; 1460 } catch(const std::exception &e) { 1461 throwJavaException(env, &e, method_name); 1462 } catch (...) { 1463 throwJavaException(env, 0, method_name); 1464 } 1465 return 0; 1466 } 1467 1468 1469 1470 // 1471 // void setVarInit(double varInit) 1472 // 1473 1474 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setVarInit_10 (JNIEnv*, jclass, jlong, jdouble); 1475 1476 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setVarInit_10 1477 (JNIEnv* env, jclass , jlong self, jdouble varInit) 1478 { 1479 static const char method_name[] = "video::setVarInit_10()"; 1480 try { 1481 LOGD("%s", method_name); 1482 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1483 (*me)->setVarInit( (double)varInit ); 1484 return; 1485 } catch(const std::exception &e) { 1486 throwJavaException(env, &e, method_name); 1487 } catch (...) { 1488 throwJavaException(env, 0, method_name); 1489 } 1490 return; 1491 } 1492 1493 1494 1495 // 1496 // double getVarMin() 1497 // 1498 1499 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getVarMin_10 (JNIEnv*, jclass, jlong); 1500 1501 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getVarMin_10 1502 (JNIEnv* env, jclass , jlong self) 1503 { 1504 static const char method_name[] = "video::getVarMin_10()"; 1505 try { 1506 LOGD("%s", method_name); 1507 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1508 double _retval_ = (*me)->getVarMin( ); 1509 return _retval_; 1510 } catch(const std::exception &e) { 1511 throwJavaException(env, &e, method_name); 1512 } catch (...) { 1513 throwJavaException(env, 0, method_name); 1514 } 1515 return 0; 1516 } 1517 1518 1519 1520 // 1521 // void setVarMin(double varMin) 1522 // 1523 1524 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setVarMin_10 (JNIEnv*, jclass, jlong, jdouble); 1525 1526 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setVarMin_10 1527 (JNIEnv* env, jclass , jlong self, jdouble varMin) 1528 { 1529 static const char method_name[] = "video::setVarMin_10()"; 1530 try { 1531 LOGD("%s", method_name); 1532 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1533 (*me)->setVarMin( (double)varMin ); 1534 return; 1535 } catch(const std::exception &e) { 1536 throwJavaException(env, &e, method_name); 1537 } catch (...) { 1538 throwJavaException(env, 0, method_name); 1539 } 1540 return; 1541 } 1542 1543 1544 1545 // 1546 // double getVarMax() 1547 // 1548 1549 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getVarMax_10 (JNIEnv*, jclass, jlong); 1550 1551 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getVarMax_10 1552 (JNIEnv* env, jclass , jlong self) 1553 { 1554 static const char method_name[] = "video::getVarMax_10()"; 1555 try { 1556 LOGD("%s", method_name); 1557 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1558 double _retval_ = (*me)->getVarMax( ); 1559 return _retval_; 1560 } catch(const std::exception &e) { 1561 throwJavaException(env, &e, method_name); 1562 } catch (...) { 1563 throwJavaException(env, 0, method_name); 1564 } 1565 return 0; 1566 } 1567 1568 1569 1570 // 1571 // void setVarMax(double varMax) 1572 // 1573 1574 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setVarMax_10 (JNIEnv*, jclass, jlong, jdouble); 1575 1576 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setVarMax_10 1577 (JNIEnv* env, jclass , jlong self, jdouble varMax) 1578 { 1579 static const char method_name[] = "video::setVarMax_10()"; 1580 try { 1581 LOGD("%s", method_name); 1582 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1583 (*me)->setVarMax( (double)varMax ); 1584 return; 1585 } catch(const std::exception &e) { 1586 throwJavaException(env, &e, method_name); 1587 } catch (...) { 1588 throwJavaException(env, 0, method_name); 1589 } 1590 return; 1591 } 1592 1593 1594 1595 // 1596 // double getComplexityReductionThreshold() 1597 // 1598 1599 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getComplexityReductionThreshold_10 (JNIEnv*, jclass, jlong); 1600 1601 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getComplexityReductionThreshold_10 1602 (JNIEnv* env, jclass , jlong self) 1603 { 1604 static const char method_name[] = "video::getComplexityReductionThreshold_10()"; 1605 try { 1606 LOGD("%s", method_name); 1607 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1608 double _retval_ = (*me)->getComplexityReductionThreshold( ); 1609 return _retval_; 1610 } catch(const std::exception &e) { 1611 throwJavaException(env, &e, method_name); 1612 } catch (...) { 1613 throwJavaException(env, 0, method_name); 1614 } 1615 return 0; 1616 } 1617 1618 1619 1620 // 1621 // void setComplexityReductionThreshold(double ct) 1622 // 1623 1624 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setComplexityReductionThreshold_10 (JNIEnv*, jclass, jlong, jdouble); 1625 1626 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setComplexityReductionThreshold_10 1627 (JNIEnv* env, jclass , jlong self, jdouble ct) 1628 { 1629 static const char method_name[] = "video::setComplexityReductionThreshold_10()"; 1630 try { 1631 LOGD("%s", method_name); 1632 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1633 (*me)->setComplexityReductionThreshold( (double)ct ); 1634 return; 1635 } catch(const std::exception &e) { 1636 throwJavaException(env, &e, method_name); 1637 } catch (...) { 1638 throwJavaException(env, 0, method_name); 1639 } 1640 return; 1641 } 1642 1643 1644 1645 // 1646 // bool getDetectShadows() 1647 // 1648 1649 JNIEXPORT jboolean JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getDetectShadows_10 (JNIEnv*, jclass, jlong); 1650 1651 JNIEXPORT jboolean JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getDetectShadows_10 1652 (JNIEnv* env, jclass , jlong self) 1653 { 1654 static const char method_name[] = "video::getDetectShadows_10()"; 1655 try { 1656 LOGD("%s", method_name); 1657 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1658 bool _retval_ = (*me)->getDetectShadows( ); 1659 return _retval_; 1660 } catch(const std::exception &e) { 1661 throwJavaException(env, &e, method_name); 1662 } catch (...) { 1663 throwJavaException(env, 0, method_name); 1664 } 1665 return 0; 1666 } 1667 1668 1669 1670 // 1671 // void setDetectShadows(bool detectShadows) 1672 // 1673 1674 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setDetectShadows_10 (JNIEnv*, jclass, jlong, jboolean); 1675 1676 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setDetectShadows_10 1677 (JNIEnv* env, jclass , jlong self, jboolean detectShadows) 1678 { 1679 static const char method_name[] = "video::setDetectShadows_10()"; 1680 try { 1681 LOGD("%s", method_name); 1682 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1683 (*me)->setDetectShadows( (bool)detectShadows ); 1684 return; 1685 } catch(const std::exception &e) { 1686 throwJavaException(env, &e, method_name); 1687 } catch (...) { 1688 throwJavaException(env, 0, method_name); 1689 } 1690 return; 1691 } 1692 1693 1694 1695 // 1696 // int getShadowValue() 1697 // 1698 1699 JNIEXPORT jint JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getShadowValue_10 (JNIEnv*, jclass, jlong); 1700 1701 JNIEXPORT jint JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getShadowValue_10 1702 (JNIEnv* env, jclass , jlong self) 1703 { 1704 static const char method_name[] = "video::getShadowValue_10()"; 1705 try { 1706 LOGD("%s", method_name); 1707 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1708 int _retval_ = (*me)->getShadowValue( ); 1709 return _retval_; 1710 } catch(const std::exception &e) { 1711 throwJavaException(env, &e, method_name); 1712 } catch (...) { 1713 throwJavaException(env, 0, method_name); 1714 } 1715 return 0; 1716 } 1717 1718 1719 1720 // 1721 // void setShadowValue(int value) 1722 // 1723 1724 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setShadowValue_10 (JNIEnv*, jclass, jlong, jint); 1725 1726 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setShadowValue_10 1727 (JNIEnv* env, jclass , jlong self, jint value) 1728 { 1729 static const char method_name[] = "video::setShadowValue_10()"; 1730 try { 1731 LOGD("%s", method_name); 1732 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1733 (*me)->setShadowValue( (int)value ); 1734 return; 1735 } catch(const std::exception &e) { 1736 throwJavaException(env, &e, method_name); 1737 } catch (...) { 1738 throwJavaException(env, 0, method_name); 1739 } 1740 return; 1741 } 1742 1743 1744 1745 // 1746 // double getShadowThreshold() 1747 // 1748 1749 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getShadowThreshold_10 (JNIEnv*, jclass, jlong); 1750 1751 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getShadowThreshold_10 1752 (JNIEnv* env, jclass , jlong self) 1753 { 1754 static const char method_name[] = "video::getShadowThreshold_10()"; 1755 try { 1756 LOGD("%s", method_name); 1757 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1758 double _retval_ = (*me)->getShadowThreshold( ); 1759 return _retval_; 1760 } catch(const std::exception &e) { 1761 throwJavaException(env, &e, method_name); 1762 } catch (...) { 1763 throwJavaException(env, 0, method_name); 1764 } 1765 return 0; 1766 } 1767 1768 1769 1770 // 1771 // void setShadowThreshold(double threshold) 1772 // 1773 1774 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setShadowThreshold_10 (JNIEnv*, jclass, jlong, jdouble); 1775 1776 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setShadowThreshold_10 1777 (JNIEnv* env, jclass , jlong self, jdouble threshold) 1778 { 1779 static const char method_name[] = "video::setShadowThreshold_10()"; 1780 try { 1781 LOGD("%s", method_name); 1782 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1783 (*me)->setShadowThreshold( (double)threshold ); 1784 return; 1785 } catch(const std::exception &e) { 1786 throwJavaException(env, &e, method_name); 1787 } catch (...) { 1788 throwJavaException(env, 0, method_name); 1789 } 1790 return; 1791 } 1792 1793 1794 1795 // 1796 // int getHistory() 1797 // 1798 1799 JNIEXPORT jint JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getHistory_10 (JNIEnv*, jclass, jlong); 1800 1801 JNIEXPORT jint JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getHistory_10 1802 (JNIEnv* env, jclass , jlong self) 1803 { 1804 static const char method_name[] = "video::getHistory_10()"; 1805 try { 1806 LOGD("%s", method_name); 1807 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1808 int _retval_ = (*me)->getHistory( ); 1809 return _retval_; 1810 } catch(const std::exception &e) { 1811 throwJavaException(env, &e, method_name); 1812 } catch (...) { 1813 throwJavaException(env, 0, method_name); 1814 } 1815 return 0; 1816 } 1817 1818 1819 1820 // 1821 // void setHistory(int history) 1822 // 1823 1824 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setHistory_10 (JNIEnv*, jclass, jlong, jint); 1825 1826 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setHistory_10 1827 (JNIEnv* env, jclass , jlong self, jint history) 1828 { 1829 static const char method_name[] = "video::setHistory_10()"; 1830 try { 1831 LOGD("%s", method_name); 1832 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1833 (*me)->setHistory( (int)history ); 1834 return; 1835 } catch(const std::exception &e) { 1836 throwJavaException(env, &e, method_name); 1837 } catch (...) { 1838 throwJavaException(env, 0, method_name); 1839 } 1840 return; 1841 } 1842 1843 1844 1845 // 1846 // int getNMixtures() 1847 // 1848 1849 JNIEXPORT jint JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getNMixtures_10 (JNIEnv*, jclass, jlong); 1850 1851 JNIEXPORT jint JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getNMixtures_10 1852 (JNIEnv* env, jclass , jlong self) 1853 { 1854 static const char method_name[] = "video::getNMixtures_10()"; 1855 try { 1856 LOGD("%s", method_name); 1857 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1858 int _retval_ = (*me)->getNMixtures( ); 1859 return _retval_; 1860 } catch(const std::exception &e) { 1861 throwJavaException(env, &e, method_name); 1862 } catch (...) { 1863 throwJavaException(env, 0, method_name); 1864 } 1865 return 0; 1866 } 1867 1868 1869 1870 // 1871 // void setNMixtures(int nmixtures) 1872 // 1873 1874 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setNMixtures_10 (JNIEnv*, jclass, jlong, jint); 1875 1876 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setNMixtures_10 1877 (JNIEnv* env, jclass , jlong self, jint nmixtures) 1878 { 1879 static const char method_name[] = "video::setNMixtures_10()"; 1880 try { 1881 LOGD("%s", method_name); 1882 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1883 (*me)->setNMixtures( (int)nmixtures ); 1884 return; 1885 } catch(const std::exception &e) { 1886 throwJavaException(env, &e, method_name); 1887 } catch (...) { 1888 throwJavaException(env, 0, method_name); 1889 } 1890 return; 1891 } 1892 1893 1894 1895 // 1896 // double getBackgroundRatio() 1897 // 1898 1899 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getBackgroundRatio_10 (JNIEnv*, jclass, jlong); 1900 1901 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_getBackgroundRatio_10 1902 (JNIEnv* env, jclass , jlong self) 1903 { 1904 static const char method_name[] = "video::getBackgroundRatio_10()"; 1905 try { 1906 LOGD("%s", method_name); 1907 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1908 double _retval_ = (*me)->getBackgroundRatio( ); 1909 return _retval_; 1910 } catch(const std::exception &e) { 1911 throwJavaException(env, &e, method_name); 1912 } catch (...) { 1913 throwJavaException(env, 0, method_name); 1914 } 1915 return 0; 1916 } 1917 1918 1919 1920 // 1921 // void setBackgroundRatio(double ratio) 1922 // 1923 1924 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setBackgroundRatio_10 (JNIEnv*, jclass, jlong, jdouble); 1925 1926 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_setBackgroundRatio_10 1927 (JNIEnv* env, jclass , jlong self, jdouble ratio) 1928 { 1929 static const char method_name[] = "video::setBackgroundRatio_10()"; 1930 try { 1931 LOGD("%s", method_name); 1932 Ptr<cv::BackgroundSubtractorMOG2>* me = (Ptr<cv::BackgroundSubtractorMOG2>*) self; //TODO: check for NULL 1933 (*me)->setBackgroundRatio( (double)ratio ); 1934 return; 1935 } catch(const std::exception &e) { 1936 throwJavaException(env, &e, method_name); 1937 } catch (...) { 1938 throwJavaException(env, 0, method_name); 1939 } 1940 return; 1941 } 1942 1943 1944 1945 // 1946 // native support for java finalize() 1947 // static void Ptr<cv::BackgroundSubtractorMOG2>::delete( __int64 self ) 1948 // 1949 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_delete(JNIEnv*, jclass, jlong); 1950 1951 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorMOG2_delete 1952 (JNIEnv*, jclass, jlong self) 1953 { 1954 delete (Ptr<cv::BackgroundSubtractorMOG2>*) self; 1955 } 1956 1957 1958 // 1959 // int getHistory() 1960 // 1961 1962 JNIEXPORT jint JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_getHistory_10 (JNIEnv*, jclass, jlong); 1963 1964 JNIEXPORT jint JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_getHistory_10 1965 (JNIEnv* env, jclass , jlong self) 1966 { 1967 static const char method_name[] = "video::getHistory_10()"; 1968 try { 1969 LOGD("%s", method_name); 1970 Ptr<cv::BackgroundSubtractorKNN>* me = (Ptr<cv::BackgroundSubtractorKNN>*) self; //TODO: check for NULL 1971 int _retval_ = (*me)->getHistory( ); 1972 return _retval_; 1973 } catch(const std::exception &e) { 1974 throwJavaException(env, &e, method_name); 1975 } catch (...) { 1976 throwJavaException(env, 0, method_name); 1977 } 1978 return 0; 1979 } 1980 1981 1982 1983 // 1984 // void setHistory(int history) 1985 // 1986 1987 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_setHistory_10 (JNIEnv*, jclass, jlong, jint); 1988 1989 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_setHistory_10 1990 (JNIEnv* env, jclass , jlong self, jint history) 1991 { 1992 static const char method_name[] = "video::setHistory_10()"; 1993 try { 1994 LOGD("%s", method_name); 1995 Ptr<cv::BackgroundSubtractorKNN>* me = (Ptr<cv::BackgroundSubtractorKNN>*) self; //TODO: check for NULL 1996 (*me)->setHistory( (int)history ); 1997 return; 1998 } catch(const std::exception &e) { 1999 throwJavaException(env, &e, method_name); 2000 } catch (...) { 2001 throwJavaException(env, 0, method_name); 2002 } 2003 return; 2004 } 2005 2006 2007 2008 // 2009 // int getNSamples() 2010 // 2011 2012 JNIEXPORT jint JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_getNSamples_10 (JNIEnv*, jclass, jlong); 2013 2014 JNIEXPORT jint JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_getNSamples_10 2015 (JNIEnv* env, jclass , jlong self) 2016 { 2017 static const char method_name[] = "video::getNSamples_10()"; 2018 try { 2019 LOGD("%s", method_name); 2020 Ptr<cv::BackgroundSubtractorKNN>* me = (Ptr<cv::BackgroundSubtractorKNN>*) self; //TODO: check for NULL 2021 int _retval_ = (*me)->getNSamples( ); 2022 return _retval_; 2023 } catch(const std::exception &e) { 2024 throwJavaException(env, &e, method_name); 2025 } catch (...) { 2026 throwJavaException(env, 0, method_name); 2027 } 2028 return 0; 2029 } 2030 2031 2032 2033 // 2034 // void setNSamples(int _nN) 2035 // 2036 2037 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_setNSamples_10 (JNIEnv*, jclass, jlong, jint); 2038 2039 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_setNSamples_10 2040 (JNIEnv* env, jclass , jlong self, jint _nN) 2041 { 2042 static const char method_name[] = "video::setNSamples_10()"; 2043 try { 2044 LOGD("%s", method_name); 2045 Ptr<cv::BackgroundSubtractorKNN>* me = (Ptr<cv::BackgroundSubtractorKNN>*) self; //TODO: check for NULL 2046 (*me)->setNSamples( (int)_nN ); 2047 return; 2048 } catch(const std::exception &e) { 2049 throwJavaException(env, &e, method_name); 2050 } catch (...) { 2051 throwJavaException(env, 0, method_name); 2052 } 2053 return; 2054 } 2055 2056 2057 2058 // 2059 // double getDist2Threshold() 2060 // 2061 2062 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_getDist2Threshold_10 (JNIEnv*, jclass, jlong); 2063 2064 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_getDist2Threshold_10 2065 (JNIEnv* env, jclass , jlong self) 2066 { 2067 static const char method_name[] = "video::getDist2Threshold_10()"; 2068 try { 2069 LOGD("%s", method_name); 2070 Ptr<cv::BackgroundSubtractorKNN>* me = (Ptr<cv::BackgroundSubtractorKNN>*) self; //TODO: check for NULL 2071 double _retval_ = (*me)->getDist2Threshold( ); 2072 return _retval_; 2073 } catch(const std::exception &e) { 2074 throwJavaException(env, &e, method_name); 2075 } catch (...) { 2076 throwJavaException(env, 0, method_name); 2077 } 2078 return 0; 2079 } 2080 2081 2082 2083 // 2084 // void setDist2Threshold(double _dist2Threshold) 2085 // 2086 2087 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_setDist2Threshold_10 (JNIEnv*, jclass, jlong, jdouble); 2088 2089 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_setDist2Threshold_10 2090 (JNIEnv* env, jclass , jlong self, jdouble _dist2Threshold) 2091 { 2092 static const char method_name[] = "video::setDist2Threshold_10()"; 2093 try { 2094 LOGD("%s", method_name); 2095 Ptr<cv::BackgroundSubtractorKNN>* me = (Ptr<cv::BackgroundSubtractorKNN>*) self; //TODO: check for NULL 2096 (*me)->setDist2Threshold( (double)_dist2Threshold ); 2097 return; 2098 } catch(const std::exception &e) { 2099 throwJavaException(env, &e, method_name); 2100 } catch (...) { 2101 throwJavaException(env, 0, method_name); 2102 } 2103 return; 2104 } 2105 2106 2107 2108 // 2109 // int getkNNSamples() 2110 // 2111 2112 JNIEXPORT jint JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_getkNNSamples_10 (JNIEnv*, jclass, jlong); 2113 2114 JNIEXPORT jint JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_getkNNSamples_10 2115 (JNIEnv* env, jclass , jlong self) 2116 { 2117 static const char method_name[] = "video::getkNNSamples_10()"; 2118 try { 2119 LOGD("%s", method_name); 2120 Ptr<cv::BackgroundSubtractorKNN>* me = (Ptr<cv::BackgroundSubtractorKNN>*) self; //TODO: check for NULL 2121 int _retval_ = (*me)->getkNNSamples( ); 2122 return _retval_; 2123 } catch(const std::exception &e) { 2124 throwJavaException(env, &e, method_name); 2125 } catch (...) { 2126 throwJavaException(env, 0, method_name); 2127 } 2128 return 0; 2129 } 2130 2131 2132 2133 // 2134 // void setkNNSamples(int _nkNN) 2135 // 2136 2137 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_setkNNSamples_10 (JNIEnv*, jclass, jlong, jint); 2138 2139 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_setkNNSamples_10 2140 (JNIEnv* env, jclass , jlong self, jint _nkNN) 2141 { 2142 static const char method_name[] = "video::setkNNSamples_10()"; 2143 try { 2144 LOGD("%s", method_name); 2145 Ptr<cv::BackgroundSubtractorKNN>* me = (Ptr<cv::BackgroundSubtractorKNN>*) self; //TODO: check for NULL 2146 (*me)->setkNNSamples( (int)_nkNN ); 2147 return; 2148 } catch(const std::exception &e) { 2149 throwJavaException(env, &e, method_name); 2150 } catch (...) { 2151 throwJavaException(env, 0, method_name); 2152 } 2153 return; 2154 } 2155 2156 2157 2158 // 2159 // bool getDetectShadows() 2160 // 2161 2162 JNIEXPORT jboolean JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_getDetectShadows_10 (JNIEnv*, jclass, jlong); 2163 2164 JNIEXPORT jboolean JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_getDetectShadows_10 2165 (JNIEnv* env, jclass , jlong self) 2166 { 2167 static const char method_name[] = "video::getDetectShadows_10()"; 2168 try { 2169 LOGD("%s", method_name); 2170 Ptr<cv::BackgroundSubtractorKNN>* me = (Ptr<cv::BackgroundSubtractorKNN>*) self; //TODO: check for NULL 2171 bool _retval_ = (*me)->getDetectShadows( ); 2172 return _retval_; 2173 } catch(const std::exception &e) { 2174 throwJavaException(env, &e, method_name); 2175 } catch (...) { 2176 throwJavaException(env, 0, method_name); 2177 } 2178 return 0; 2179 } 2180 2181 2182 2183 // 2184 // void setDetectShadows(bool detectShadows) 2185 // 2186 2187 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_setDetectShadows_10 (JNIEnv*, jclass, jlong, jboolean); 2188 2189 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_setDetectShadows_10 2190 (JNIEnv* env, jclass , jlong self, jboolean detectShadows) 2191 { 2192 static const char method_name[] = "video::setDetectShadows_10()"; 2193 try { 2194 LOGD("%s", method_name); 2195 Ptr<cv::BackgroundSubtractorKNN>* me = (Ptr<cv::BackgroundSubtractorKNN>*) self; //TODO: check for NULL 2196 (*me)->setDetectShadows( (bool)detectShadows ); 2197 return; 2198 } catch(const std::exception &e) { 2199 throwJavaException(env, &e, method_name); 2200 } catch (...) { 2201 throwJavaException(env, 0, method_name); 2202 } 2203 return; 2204 } 2205 2206 2207 2208 // 2209 // int getShadowValue() 2210 // 2211 2212 JNIEXPORT jint JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_getShadowValue_10 (JNIEnv*, jclass, jlong); 2213 2214 JNIEXPORT jint JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_getShadowValue_10 2215 (JNIEnv* env, jclass , jlong self) 2216 { 2217 static const char method_name[] = "video::getShadowValue_10()"; 2218 try { 2219 LOGD("%s", method_name); 2220 Ptr<cv::BackgroundSubtractorKNN>* me = (Ptr<cv::BackgroundSubtractorKNN>*) self; //TODO: check for NULL 2221 int _retval_ = (*me)->getShadowValue( ); 2222 return _retval_; 2223 } catch(const std::exception &e) { 2224 throwJavaException(env, &e, method_name); 2225 } catch (...) { 2226 throwJavaException(env, 0, method_name); 2227 } 2228 return 0; 2229 } 2230 2231 2232 2233 // 2234 // void setShadowValue(int value) 2235 // 2236 2237 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_setShadowValue_10 (JNIEnv*, jclass, jlong, jint); 2238 2239 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_setShadowValue_10 2240 (JNIEnv* env, jclass , jlong self, jint value) 2241 { 2242 static const char method_name[] = "video::setShadowValue_10()"; 2243 try { 2244 LOGD("%s", method_name); 2245 Ptr<cv::BackgroundSubtractorKNN>* me = (Ptr<cv::BackgroundSubtractorKNN>*) self; //TODO: check for NULL 2246 (*me)->setShadowValue( (int)value ); 2247 return; 2248 } catch(const std::exception &e) { 2249 throwJavaException(env, &e, method_name); 2250 } catch (...) { 2251 throwJavaException(env, 0, method_name); 2252 } 2253 return; 2254 } 2255 2256 2257 2258 // 2259 // double getShadowThreshold() 2260 // 2261 2262 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_getShadowThreshold_10 (JNIEnv*, jclass, jlong); 2263 2264 JNIEXPORT jdouble JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_getShadowThreshold_10 2265 (JNIEnv* env, jclass , jlong self) 2266 { 2267 static const char method_name[] = "video::getShadowThreshold_10()"; 2268 try { 2269 LOGD("%s", method_name); 2270 Ptr<cv::BackgroundSubtractorKNN>* me = (Ptr<cv::BackgroundSubtractorKNN>*) self; //TODO: check for NULL 2271 double _retval_ = (*me)->getShadowThreshold( ); 2272 return _retval_; 2273 } catch(const std::exception &e) { 2274 throwJavaException(env, &e, method_name); 2275 } catch (...) { 2276 throwJavaException(env, 0, method_name); 2277 } 2278 return 0; 2279 } 2280 2281 2282 2283 // 2284 // void setShadowThreshold(double threshold) 2285 // 2286 2287 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_setShadowThreshold_10 (JNIEnv*, jclass, jlong, jdouble); 2288 2289 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_setShadowThreshold_10 2290 (JNIEnv* env, jclass , jlong self, jdouble threshold) 2291 { 2292 static const char method_name[] = "video::setShadowThreshold_10()"; 2293 try { 2294 LOGD("%s", method_name); 2295 Ptr<cv::BackgroundSubtractorKNN>* me = (Ptr<cv::BackgroundSubtractorKNN>*) self; //TODO: check for NULL 2296 (*me)->setShadowThreshold( (double)threshold ); 2297 return; 2298 } catch(const std::exception &e) { 2299 throwJavaException(env, &e, method_name); 2300 } catch (...) { 2301 throwJavaException(env, 0, method_name); 2302 } 2303 return; 2304 } 2305 2306 2307 2308 // 2309 // native support for java finalize() 2310 // static void Ptr<cv::BackgroundSubtractorKNN>::delete( __int64 self ) 2311 // 2312 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_delete(JNIEnv*, jclass, jlong); 2313 2314 JNIEXPORT void JNICALL Java_org_opencv_video_BackgroundSubtractorKNN_delete 2315 (JNIEnv*, jclass, jlong self) 2316 { 2317 delete (Ptr<cv::BackgroundSubtractorKNN>*) self; 2318 } 2319 2320 2321 2322 } // extern "C" 2323 2324 #endif // HAVE_OPENCV_VIDEO 2325