1
2 //
3 // This file is auto-generated, please don't edit!
4 //
5
6 #define LOG_TAG "org.opencv.features2d"
7
8 #include "common.h"
9
10 #include "opencv2/opencv_modules.hpp"
11 #ifdef HAVE_OPENCV_FEATURES2D
12
13 #include <string>
14
15 #include "opencv2/features2d.hpp"
16
17 #include "../../features2d/misc/java/src/cpp/features2d_manual.hpp"
18
19 using namespace cv;
20
21 /// throw java exception
throwJavaException(JNIEnv * env,const std::exception * e,const char * method)22 static void throwJavaException(JNIEnv *env, const std::exception *e, const char *method) {
23 std::string what = "unknown exception";
24 jclass je = 0;
25
26 if(e) {
27 std::string exception_type = "std::exception";
28
29 if(dynamic_cast<const cv::Exception*>(e)) {
30 exception_type = "cv::Exception";
31 je = env->FindClass("org/opencv/core/CvException");
32 }
33
34 what = exception_type + ": " + e->what();
35 }
36
37 if(!je) je = env->FindClass("java/lang/Exception");
38 env->ThrowNew(je, what.c_str());
39
40 LOGE("%s caught %s", method, what.c_str());
41 (void)method; // avoid "unused" warning
42 }
43
44
45 extern "C" {
46
47
48 //
49 // void compute(Mat image, vector_KeyPoint& keypoints, Mat descriptors)
50 //
51
52 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorExtractor_compute_10 (JNIEnv*, jclass, jlong, jlong, jlong, jlong);
53
Java_org_opencv_features2d_DescriptorExtractor_compute_10(JNIEnv * env,jclass,jlong self,jlong image_nativeObj,jlong keypoints_mat_nativeObj,jlong descriptors_nativeObj)54 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorExtractor_compute_10
55 (JNIEnv* env, jclass , jlong self, jlong image_nativeObj, jlong keypoints_mat_nativeObj, jlong descriptors_nativeObj)
56 {
57 static const char method_name[] = "features2d::compute_10()";
58 try {
59 LOGD("%s", method_name);
60 std::vector<KeyPoint> keypoints;
61 Mat& keypoints_mat = *((Mat*)keypoints_mat_nativeObj);
62 Mat_to_vector_KeyPoint( keypoints_mat, keypoints );
63 cv::javaDescriptorExtractor* me = (cv::javaDescriptorExtractor*) self; //TODO: check for NULL
64 Mat& image = *((Mat*)image_nativeObj);
65 Mat& descriptors = *((Mat*)descriptors_nativeObj);
66 me->compute( image, keypoints, descriptors );
67 vector_KeyPoint_to_Mat( keypoints, keypoints_mat );
68 return;
69 } catch(const std::exception &e) {
70 throwJavaException(env, &e, method_name);
71 } catch (...) {
72 throwJavaException(env, 0, method_name);
73 }
74 return;
75 }
76
77
78
79 //
80 // void compute(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat& descriptors)
81 //
82
83 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorExtractor_compute_11 (JNIEnv*, jclass, jlong, jlong, jlong, jlong);
84
Java_org_opencv_features2d_DescriptorExtractor_compute_11(JNIEnv * env,jclass,jlong self,jlong images_mat_nativeObj,jlong keypoints_mat_nativeObj,jlong descriptors_mat_nativeObj)85 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorExtractor_compute_11
86 (JNIEnv* env, jclass , jlong self, jlong images_mat_nativeObj, jlong keypoints_mat_nativeObj, jlong descriptors_mat_nativeObj)
87 {
88 static const char method_name[] = "features2d::compute_11()";
89 try {
90 LOGD("%s", method_name);
91 std::vector<Mat> images;
92 Mat& images_mat = *((Mat*)images_mat_nativeObj);
93 Mat_to_vector_Mat( images_mat, images );
94 std::vector< std::vector<KeyPoint> > keypoints;
95 Mat& keypoints_mat = *((Mat*)keypoints_mat_nativeObj);
96 Mat_to_vector_vector_KeyPoint( keypoints_mat, keypoints );
97 std::vector<Mat> descriptors;
98 Mat& descriptors_mat = *((Mat*)descriptors_mat_nativeObj);
99 cv::javaDescriptorExtractor* me = (cv::javaDescriptorExtractor*) self; //TODO: check for NULL
100 me->compute( images, keypoints, descriptors );
101 vector_vector_KeyPoint_to_Mat( keypoints, keypoints_mat ); vector_Mat_to_Mat( descriptors, descriptors_mat );
102 return;
103 } catch(const std::exception &e) {
104 throwJavaException(env, &e, method_name);
105 } catch (...) {
106 throwJavaException(env, 0, method_name);
107 }
108 return;
109 }
110
111
112
113 //
114 // int descriptorSize()
115 //
116
117 JNIEXPORT jint JNICALL Java_org_opencv_features2d_DescriptorExtractor_descriptorSize_10 (JNIEnv*, jclass, jlong);
118
Java_org_opencv_features2d_DescriptorExtractor_descriptorSize_10(JNIEnv * env,jclass,jlong self)119 JNIEXPORT jint JNICALL Java_org_opencv_features2d_DescriptorExtractor_descriptorSize_10
120 (JNIEnv* env, jclass , jlong self)
121 {
122 static const char method_name[] = "features2d::descriptorSize_10()";
123 try {
124 LOGD("%s", method_name);
125 cv::javaDescriptorExtractor* me = (cv::javaDescriptorExtractor*) self; //TODO: check for NULL
126 int _retval_ = me->descriptorSize( );
127 return _retval_;
128 } catch(const std::exception &e) {
129 throwJavaException(env, &e, method_name);
130 } catch (...) {
131 throwJavaException(env, 0, method_name);
132 }
133 return 0;
134 }
135
136
137
138 //
139 // int descriptorType()
140 //
141
142 JNIEXPORT jint JNICALL Java_org_opencv_features2d_DescriptorExtractor_descriptorType_10 (JNIEnv*, jclass, jlong);
143
Java_org_opencv_features2d_DescriptorExtractor_descriptorType_10(JNIEnv * env,jclass,jlong self)144 JNIEXPORT jint JNICALL Java_org_opencv_features2d_DescriptorExtractor_descriptorType_10
145 (JNIEnv* env, jclass , jlong self)
146 {
147 static const char method_name[] = "features2d::descriptorType_10()";
148 try {
149 LOGD("%s", method_name);
150 cv::javaDescriptorExtractor* me = (cv::javaDescriptorExtractor*) self; //TODO: check for NULL
151 int _retval_ = me->descriptorType( );
152 return _retval_;
153 } catch(const std::exception &e) {
154 throwJavaException(env, &e, method_name);
155 } catch (...) {
156 throwJavaException(env, 0, method_name);
157 }
158 return 0;
159 }
160
161
162
163 //
164 // bool empty()
165 //
166
167 JNIEXPORT jboolean JNICALL Java_org_opencv_features2d_DescriptorExtractor_empty_10 (JNIEnv*, jclass, jlong);
168
Java_org_opencv_features2d_DescriptorExtractor_empty_10(JNIEnv * env,jclass,jlong self)169 JNIEXPORT jboolean JNICALL Java_org_opencv_features2d_DescriptorExtractor_empty_10
170 (JNIEnv* env, jclass , jlong self)
171 {
172 static const char method_name[] = "features2d::empty_10()";
173 try {
174 LOGD("%s", method_name);
175 cv::javaDescriptorExtractor* me = (cv::javaDescriptorExtractor*) self; //TODO: check for NULL
176 bool _retval_ = me->empty( );
177 return _retval_;
178 } catch(const std::exception &e) {
179 throwJavaException(env, &e, method_name);
180 } catch (...) {
181 throwJavaException(env, 0, method_name);
182 }
183 return 0;
184 }
185
186
187
188 //
189 // static javaDescriptorExtractor* create(int extractorType)
190 //
191
192 JNIEXPORT jlong JNICALL Java_org_opencv_features2d_DescriptorExtractor_create_10 (JNIEnv*, jclass, jint);
193
Java_org_opencv_features2d_DescriptorExtractor_create_10(JNIEnv * env,jclass,jint extractorType)194 JNIEXPORT jlong JNICALL Java_org_opencv_features2d_DescriptorExtractor_create_10
195 (JNIEnv* env, jclass , jint extractorType)
196 {
197 static const char method_name[] = "features2d::create_10()";
198 try {
199 LOGD("%s", method_name);
200
201 javaDescriptorExtractor* _retval_ = cv::javaDescriptorExtractor::create( (int)extractorType );
202 return (jlong) _retval_;
203 } catch(const std::exception &e) {
204 throwJavaException(env, &e, method_name);
205 } catch (...) {
206 throwJavaException(env, 0, method_name);
207 }
208 return 0;
209 }
210
211
212
213 //
214 // void write(String fileName)
215 //
216
217 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorExtractor_write_10 (JNIEnv*, jclass, jlong, jstring);
218
Java_org_opencv_features2d_DescriptorExtractor_write_10(JNIEnv * env,jclass,jlong self,jstring fileName)219 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorExtractor_write_10
220 (JNIEnv* env, jclass , jlong self, jstring fileName)
221 {
222 static const char method_name[] = "features2d::write_10()";
223 try {
224 LOGD("%s", method_name);
225 cv::javaDescriptorExtractor* me = (cv::javaDescriptorExtractor*) self; //TODO: check for NULL
226 const char* utf_fileName = env->GetStringUTFChars(fileName, 0); String n_fileName( utf_fileName ? utf_fileName : "" ); env->ReleaseStringUTFChars(fileName, utf_fileName);
227 me->write( n_fileName );
228 return;
229 } catch(const std::exception &e) {
230 throwJavaException(env, &e, method_name);
231 } catch (...) {
232 throwJavaException(env, 0, method_name);
233 }
234 return;
235 }
236
237
238
239 //
240 // void read(String fileName)
241 //
242
243 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorExtractor_read_10 (JNIEnv*, jclass, jlong, jstring);
244
Java_org_opencv_features2d_DescriptorExtractor_read_10(JNIEnv * env,jclass,jlong self,jstring fileName)245 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorExtractor_read_10
246 (JNIEnv* env, jclass , jlong self, jstring fileName)
247 {
248 static const char method_name[] = "features2d::read_10()";
249 try {
250 LOGD("%s", method_name);
251 cv::javaDescriptorExtractor* me = (cv::javaDescriptorExtractor*) self; //TODO: check for NULL
252 const char* utf_fileName = env->GetStringUTFChars(fileName, 0); String n_fileName( utf_fileName ? utf_fileName : "" ); env->ReleaseStringUTFChars(fileName, utf_fileName);
253 me->read( n_fileName );
254 return;
255 } catch(const std::exception &e) {
256 throwJavaException(env, &e, method_name);
257 } catch (...) {
258 throwJavaException(env, 0, method_name);
259 }
260 return;
261 }
262
263
264
265 //
266 // native support for java finalize()
267 // static void cv::javaDescriptorExtractor::delete( __int64 self )
268 //
269 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorExtractor_delete(JNIEnv*, jclass, jlong);
270
Java_org_opencv_features2d_DescriptorExtractor_delete(JNIEnv *,jclass,jlong self)271 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorExtractor_delete
272 (JNIEnv*, jclass, jlong self)
273 {
274 delete (cv::javaDescriptorExtractor*) self;
275 }
276
277
278 //
279 // void drawKeypoints(Mat image, vector_KeyPoint keypoints, Mat outImage, Scalar color = Scalar::all(-1), int flags = 0)
280 //
281
282 JNIEXPORT void JNICALL Java_org_opencv_features2d_Features2d_drawKeypoints_10 (JNIEnv*, jclass, jlong, jlong, jlong, jdouble, jdouble, jdouble, jdouble, jint);
283
Java_org_opencv_features2d_Features2d_drawKeypoints_10(JNIEnv * env,jclass,jlong image_nativeObj,jlong keypoints_mat_nativeObj,jlong outImage_nativeObj,jdouble color_val0,jdouble color_val1,jdouble color_val2,jdouble color_val3,jint flags)284 JNIEXPORT void JNICALL Java_org_opencv_features2d_Features2d_drawKeypoints_10
285 (JNIEnv* env, jclass , jlong image_nativeObj, jlong keypoints_mat_nativeObj, jlong outImage_nativeObj, jdouble color_val0, jdouble color_val1, jdouble color_val2, jdouble color_val3, jint flags)
286 {
287 static const char method_name[] = "features2d::drawKeypoints_10()";
288 try {
289 LOGD("%s", method_name);
290 std::vector<KeyPoint> keypoints;
291 Mat& keypoints_mat = *((Mat*)keypoints_mat_nativeObj);
292 Mat_to_vector_KeyPoint( keypoints_mat, keypoints );
293 Mat& image = *((Mat*)image_nativeObj);
294 Mat& outImage = *((Mat*)outImage_nativeObj);
295 Scalar color(color_val0, color_val1, color_val2, color_val3);
296 cv::drawKeypoints( image, keypoints, outImage, color, (int)flags );
297 return;
298 } catch(const std::exception &e) {
299 throwJavaException(env, &e, method_name);
300 } catch (...) {
301 throwJavaException(env, 0, method_name);
302 }
303 return;
304 }
305
306
307
308 JNIEXPORT void JNICALL Java_org_opencv_features2d_Features2d_drawKeypoints_11 (JNIEnv*, jclass, jlong, jlong, jlong);
309
Java_org_opencv_features2d_Features2d_drawKeypoints_11(JNIEnv * env,jclass,jlong image_nativeObj,jlong keypoints_mat_nativeObj,jlong outImage_nativeObj)310 JNIEXPORT void JNICALL Java_org_opencv_features2d_Features2d_drawKeypoints_11
311 (JNIEnv* env, jclass , jlong image_nativeObj, jlong keypoints_mat_nativeObj, jlong outImage_nativeObj)
312 {
313 static const char method_name[] = "features2d::drawKeypoints_11()";
314 try {
315 LOGD("%s", method_name);
316 std::vector<KeyPoint> keypoints;
317 Mat& keypoints_mat = *((Mat*)keypoints_mat_nativeObj);
318 Mat_to_vector_KeyPoint( keypoints_mat, keypoints );
319 Mat& image = *((Mat*)image_nativeObj);
320 Mat& outImage = *((Mat*)outImage_nativeObj);
321 cv::drawKeypoints( image, keypoints, outImage );
322 return;
323 } catch(const std::exception &e) {
324 throwJavaException(env, &e, method_name);
325 } catch (...) {
326 throwJavaException(env, 0, method_name);
327 }
328 return;
329 }
330
331
332
333 //
334 // void drawMatches(Mat img1, vector_KeyPoint keypoints1, Mat img2, vector_KeyPoint keypoints2, vector_DMatch matches1to2, Mat outImg, Scalar matchColor = Scalar::all(-1), Scalar singlePointColor = Scalar::all(-1), vector_char matchesMask = std::vector<char>(), int flags = 0)
335 //
336
337 JNIEXPORT void JNICALL Java_org_opencv_features2d_Features2d_drawMatches_10 (JNIEnv*, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble, jlong, jint);
338
Java_org_opencv_features2d_Features2d_drawMatches_10(JNIEnv * env,jclass,jlong img1_nativeObj,jlong keypoints1_mat_nativeObj,jlong img2_nativeObj,jlong keypoints2_mat_nativeObj,jlong matches1to2_mat_nativeObj,jlong outImg_nativeObj,jdouble matchColor_val0,jdouble matchColor_val1,jdouble matchColor_val2,jdouble matchColor_val3,jdouble singlePointColor_val0,jdouble singlePointColor_val1,jdouble singlePointColor_val2,jdouble singlePointColor_val3,jlong matchesMask_mat_nativeObj,jint flags)339 JNIEXPORT void JNICALL Java_org_opencv_features2d_Features2d_drawMatches_10
340 (JNIEnv* env, jclass , jlong img1_nativeObj, jlong keypoints1_mat_nativeObj, jlong img2_nativeObj, jlong keypoints2_mat_nativeObj, jlong matches1to2_mat_nativeObj, jlong outImg_nativeObj, jdouble matchColor_val0, jdouble matchColor_val1, jdouble matchColor_val2, jdouble matchColor_val3, jdouble singlePointColor_val0, jdouble singlePointColor_val1, jdouble singlePointColor_val2, jdouble singlePointColor_val3, jlong matchesMask_mat_nativeObj, jint flags)
341 {
342 static const char method_name[] = "features2d::drawMatches_10()";
343 try {
344 LOGD("%s", method_name);
345 std::vector<KeyPoint> keypoints1;
346 Mat& keypoints1_mat = *((Mat*)keypoints1_mat_nativeObj);
347 Mat_to_vector_KeyPoint( keypoints1_mat, keypoints1 );
348 std::vector<KeyPoint> keypoints2;
349 Mat& keypoints2_mat = *((Mat*)keypoints2_mat_nativeObj);
350 Mat_to_vector_KeyPoint( keypoints2_mat, keypoints2 );
351 std::vector<DMatch> matches1to2;
352 Mat& matches1to2_mat = *((Mat*)matches1to2_mat_nativeObj);
353 Mat_to_vector_DMatch( matches1to2_mat, matches1to2 );
354 std::vector<char> matchesMask;
355 Mat& matchesMask_mat = *((Mat*)matchesMask_mat_nativeObj);
356 Mat_to_vector_char( matchesMask_mat, matchesMask );
357 Mat& img1 = *((Mat*)img1_nativeObj);
358 Mat& img2 = *((Mat*)img2_nativeObj);
359 Mat& outImg = *((Mat*)outImg_nativeObj);
360 Scalar matchColor(matchColor_val0, matchColor_val1, matchColor_val2, matchColor_val3);
361 Scalar singlePointColor(singlePointColor_val0, singlePointColor_val1, singlePointColor_val2, singlePointColor_val3);
362 cv::drawMatches( img1, keypoints1, img2, keypoints2, matches1to2, outImg, matchColor, singlePointColor, matchesMask, (int)flags );
363 return;
364 } catch(const std::exception &e) {
365 throwJavaException(env, &e, method_name);
366 } catch (...) {
367 throwJavaException(env, 0, method_name);
368 }
369 return;
370 }
371
372
373
374 JNIEXPORT void JNICALL Java_org_opencv_features2d_Features2d_drawMatches_11 (JNIEnv*, jclass, jlong, jlong, jlong, jlong, jlong, jlong);
375
Java_org_opencv_features2d_Features2d_drawMatches_11(JNIEnv * env,jclass,jlong img1_nativeObj,jlong keypoints1_mat_nativeObj,jlong img2_nativeObj,jlong keypoints2_mat_nativeObj,jlong matches1to2_mat_nativeObj,jlong outImg_nativeObj)376 JNIEXPORT void JNICALL Java_org_opencv_features2d_Features2d_drawMatches_11
377 (JNIEnv* env, jclass , jlong img1_nativeObj, jlong keypoints1_mat_nativeObj, jlong img2_nativeObj, jlong keypoints2_mat_nativeObj, jlong matches1to2_mat_nativeObj, jlong outImg_nativeObj)
378 {
379 static const char method_name[] = "features2d::drawMatches_11()";
380 try {
381 LOGD("%s", method_name);
382 std::vector<KeyPoint> keypoints1;
383 Mat& keypoints1_mat = *((Mat*)keypoints1_mat_nativeObj);
384 Mat_to_vector_KeyPoint( keypoints1_mat, keypoints1 );
385 std::vector<KeyPoint> keypoints2;
386 Mat& keypoints2_mat = *((Mat*)keypoints2_mat_nativeObj);
387 Mat_to_vector_KeyPoint( keypoints2_mat, keypoints2 );
388 std::vector<DMatch> matches1to2;
389 Mat& matches1to2_mat = *((Mat*)matches1to2_mat_nativeObj);
390 Mat_to_vector_DMatch( matches1to2_mat, matches1to2 );
391 Mat& img1 = *((Mat*)img1_nativeObj);
392 Mat& img2 = *((Mat*)img2_nativeObj);
393 Mat& outImg = *((Mat*)outImg_nativeObj);
394 cv::drawMatches( img1, keypoints1, img2, keypoints2, matches1to2, outImg );
395 return;
396 } catch(const std::exception &e) {
397 throwJavaException(env, &e, method_name);
398 } catch (...) {
399 throwJavaException(env, 0, method_name);
400 }
401 return;
402 }
403
404
405
406 //
407 // void drawMatches(Mat img1, vector_KeyPoint keypoints1, Mat img2, vector_KeyPoint keypoints2, vector_vector_DMatch matches1to2, Mat outImg, Scalar matchColor = Scalar::all(-1), Scalar singlePointColor = Scalar::all(-1), vector_vector_char matchesMask = std::vector<std::vector<char> >(), int flags = 0)
408 //
409
410 JNIEXPORT void JNICALL Java_org_opencv_features2d_Features2d_drawMatches2_10 (JNIEnv*, jclass, jlong, jlong, jlong, jlong, jlong, jlong, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble, jdouble, jlong, jint);
411
Java_org_opencv_features2d_Features2d_drawMatches2_10(JNIEnv * env,jclass,jlong img1_nativeObj,jlong keypoints1_mat_nativeObj,jlong img2_nativeObj,jlong keypoints2_mat_nativeObj,jlong matches1to2_mat_nativeObj,jlong outImg_nativeObj,jdouble matchColor_val0,jdouble matchColor_val1,jdouble matchColor_val2,jdouble matchColor_val3,jdouble singlePointColor_val0,jdouble singlePointColor_val1,jdouble singlePointColor_val2,jdouble singlePointColor_val3,jlong matchesMask_mat_nativeObj,jint flags)412 JNIEXPORT void JNICALL Java_org_opencv_features2d_Features2d_drawMatches2_10
413 (JNIEnv* env, jclass , jlong img1_nativeObj, jlong keypoints1_mat_nativeObj, jlong img2_nativeObj, jlong keypoints2_mat_nativeObj, jlong matches1to2_mat_nativeObj, jlong outImg_nativeObj, jdouble matchColor_val0, jdouble matchColor_val1, jdouble matchColor_val2, jdouble matchColor_val3, jdouble singlePointColor_val0, jdouble singlePointColor_val1, jdouble singlePointColor_val2, jdouble singlePointColor_val3, jlong matchesMask_mat_nativeObj, jint flags)
414 {
415 static const char method_name[] = "features2d::drawMatches2_10()";
416 try {
417 LOGD("%s", method_name);
418 std::vector<KeyPoint> keypoints1;
419 Mat& keypoints1_mat = *((Mat*)keypoints1_mat_nativeObj);
420 Mat_to_vector_KeyPoint( keypoints1_mat, keypoints1 );
421 std::vector<KeyPoint> keypoints2;
422 Mat& keypoints2_mat = *((Mat*)keypoints2_mat_nativeObj);
423 Mat_to_vector_KeyPoint( keypoints2_mat, keypoints2 );
424 std::vector< std::vector<DMatch> > matches1to2;
425 Mat& matches1to2_mat = *((Mat*)matches1to2_mat_nativeObj);
426 Mat_to_vector_vector_DMatch( matches1to2_mat, matches1to2 );
427 std::vector< std::vector<char> > matchesMask;
428 Mat& matchesMask_mat = *((Mat*)matchesMask_mat_nativeObj);
429 Mat_to_vector_vector_char( matchesMask_mat, matchesMask );
430 Mat& img1 = *((Mat*)img1_nativeObj);
431 Mat& img2 = *((Mat*)img2_nativeObj);
432 Mat& outImg = *((Mat*)outImg_nativeObj);
433 Scalar matchColor(matchColor_val0, matchColor_val1, matchColor_val2, matchColor_val3);
434 Scalar singlePointColor(singlePointColor_val0, singlePointColor_val1, singlePointColor_val2, singlePointColor_val3);
435 cv::drawMatches( img1, keypoints1, img2, keypoints2, matches1to2, outImg, matchColor, singlePointColor, matchesMask, (int)flags );
436 return;
437 } catch(const std::exception &e) {
438 throwJavaException(env, &e, method_name);
439 } catch (...) {
440 throwJavaException(env, 0, method_name);
441 }
442 return;
443 }
444
445
446
447 JNIEXPORT void JNICALL Java_org_opencv_features2d_Features2d_drawMatches2_11 (JNIEnv*, jclass, jlong, jlong, jlong, jlong, jlong, jlong);
448
Java_org_opencv_features2d_Features2d_drawMatches2_11(JNIEnv * env,jclass,jlong img1_nativeObj,jlong keypoints1_mat_nativeObj,jlong img2_nativeObj,jlong keypoints2_mat_nativeObj,jlong matches1to2_mat_nativeObj,jlong outImg_nativeObj)449 JNIEXPORT void JNICALL Java_org_opencv_features2d_Features2d_drawMatches2_11
450 (JNIEnv* env, jclass , jlong img1_nativeObj, jlong keypoints1_mat_nativeObj, jlong img2_nativeObj, jlong keypoints2_mat_nativeObj, jlong matches1to2_mat_nativeObj, jlong outImg_nativeObj)
451 {
452 static const char method_name[] = "features2d::drawMatches2_11()";
453 try {
454 LOGD("%s", method_name);
455 std::vector<KeyPoint> keypoints1;
456 Mat& keypoints1_mat = *((Mat*)keypoints1_mat_nativeObj);
457 Mat_to_vector_KeyPoint( keypoints1_mat, keypoints1 );
458 std::vector<KeyPoint> keypoints2;
459 Mat& keypoints2_mat = *((Mat*)keypoints2_mat_nativeObj);
460 Mat_to_vector_KeyPoint( keypoints2_mat, keypoints2 );
461 std::vector< std::vector<DMatch> > matches1to2;
462 Mat& matches1to2_mat = *((Mat*)matches1to2_mat_nativeObj);
463 Mat_to_vector_vector_DMatch( matches1to2_mat, matches1to2 );
464 Mat& img1 = *((Mat*)img1_nativeObj);
465 Mat& img2 = *((Mat*)img2_nativeObj);
466 Mat& outImg = *((Mat*)outImg_nativeObj);
467 cv::drawMatches( img1, keypoints1, img2, keypoints2, matches1to2, outImg );
468 return;
469 } catch(const std::exception &e) {
470 throwJavaException(env, &e, method_name);
471 } catch (...) {
472 throwJavaException(env, 0, method_name);
473 }
474 return;
475 }
476
477
478
479 //
480 // bool isMaskSupported()
481 //
482
483 JNIEXPORT jboolean JNICALL Java_org_opencv_features2d_DescriptorMatcher_isMaskSupported_10 (JNIEnv*, jclass, jlong);
484
Java_org_opencv_features2d_DescriptorMatcher_isMaskSupported_10(JNIEnv * env,jclass,jlong self)485 JNIEXPORT jboolean JNICALL Java_org_opencv_features2d_DescriptorMatcher_isMaskSupported_10
486 (JNIEnv* env, jclass , jlong self)
487 {
488 static const char method_name[] = "features2d::isMaskSupported_10()";
489 try {
490 LOGD("%s", method_name);
491 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
492 bool _retval_ = me->isMaskSupported( );
493 return _retval_;
494 } catch(const std::exception &e) {
495 throwJavaException(env, &e, method_name);
496 } catch (...) {
497 throwJavaException(env, 0, method_name);
498 }
499 return 0;
500 }
501
502
503
504 //
505 // void add(vector_Mat descriptors)
506 //
507
508 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_add_10 (JNIEnv*, jclass, jlong, jlong);
509
Java_org_opencv_features2d_DescriptorMatcher_add_10(JNIEnv * env,jclass,jlong self,jlong descriptors_mat_nativeObj)510 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_add_10
511 (JNIEnv* env, jclass , jlong self, jlong descriptors_mat_nativeObj)
512 {
513 static const char method_name[] = "features2d::add_10()";
514 try {
515 LOGD("%s", method_name);
516 std::vector<Mat> descriptors;
517 Mat& descriptors_mat = *((Mat*)descriptors_mat_nativeObj);
518 Mat_to_vector_Mat( descriptors_mat, descriptors );
519 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
520 me->add( descriptors );
521 return;
522 } catch(const std::exception &e) {
523 throwJavaException(env, &e, method_name);
524 } catch (...) {
525 throwJavaException(env, 0, method_name);
526 }
527 return;
528 }
529
530
531
532 //
533 // vector_Mat getTrainDescriptors()
534 //
535
536 JNIEXPORT jlong JNICALL Java_org_opencv_features2d_DescriptorMatcher_getTrainDescriptors_10 (JNIEnv*, jclass, jlong);
537
Java_org_opencv_features2d_DescriptorMatcher_getTrainDescriptors_10(JNIEnv * env,jclass,jlong self)538 JNIEXPORT jlong JNICALL Java_org_opencv_features2d_DescriptorMatcher_getTrainDescriptors_10
539 (JNIEnv* env, jclass , jlong self)
540 {
541 static const char method_name[] = "features2d::getTrainDescriptors_10()";
542 try {
543 LOGD("%s", method_name);
544 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
545 std::vector<Mat> _ret_val_vector_ = me->getTrainDescriptors( );
546 Mat* _retval_ = new Mat(); vector_Mat_to_Mat(_ret_val_vector_, *_retval_);
547 return (jlong) _retval_;
548 } catch(const std::exception &e) {
549 throwJavaException(env, &e, method_name);
550 } catch (...) {
551 throwJavaException(env, 0, method_name);
552 }
553 return 0;
554 }
555
556
557
558 //
559 // void clear()
560 //
561
562 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_clear_10 (JNIEnv*, jclass, jlong);
563
Java_org_opencv_features2d_DescriptorMatcher_clear_10(JNIEnv * env,jclass,jlong self)564 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_clear_10
565 (JNIEnv* env, jclass , jlong self)
566 {
567 static const char method_name[] = "features2d::clear_10()";
568 try {
569 LOGD("%s", method_name);
570 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
571 me->clear( );
572 return;
573 } catch(const std::exception &e) {
574 throwJavaException(env, &e, method_name);
575 } catch (...) {
576 throwJavaException(env, 0, method_name);
577 }
578 return;
579 }
580
581
582
583 //
584 // bool empty()
585 //
586
587 JNIEXPORT jboolean JNICALL Java_org_opencv_features2d_DescriptorMatcher_empty_10 (JNIEnv*, jclass, jlong);
588
Java_org_opencv_features2d_DescriptorMatcher_empty_10(JNIEnv * env,jclass,jlong self)589 JNIEXPORT jboolean JNICALL Java_org_opencv_features2d_DescriptorMatcher_empty_10
590 (JNIEnv* env, jclass , jlong self)
591 {
592 static const char method_name[] = "features2d::empty_10()";
593 try {
594 LOGD("%s", method_name);
595 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
596 bool _retval_ = me->empty( );
597 return _retval_;
598 } catch(const std::exception &e) {
599 throwJavaException(env, &e, method_name);
600 } catch (...) {
601 throwJavaException(env, 0, method_name);
602 }
603 return 0;
604 }
605
606
607
608 //
609 // void train()
610 //
611
612 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_train_10 (JNIEnv*, jclass, jlong);
613
Java_org_opencv_features2d_DescriptorMatcher_train_10(JNIEnv * env,jclass,jlong self)614 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_train_10
615 (JNIEnv* env, jclass , jlong self)
616 {
617 static const char method_name[] = "features2d::train_10()";
618 try {
619 LOGD("%s", method_name);
620 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
621 me->train( );
622 return;
623 } catch(const std::exception &e) {
624 throwJavaException(env, &e, method_name);
625 } catch (...) {
626 throwJavaException(env, 0, method_name);
627 }
628 return;
629 }
630
631
632
633 //
634 // void match(Mat queryDescriptors, Mat trainDescriptors, vector_DMatch& matches, Mat mask = Mat())
635 //
636
637 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_match_10 (JNIEnv*, jclass, jlong, jlong, jlong, jlong, jlong);
638
Java_org_opencv_features2d_DescriptorMatcher_match_10(JNIEnv * env,jclass,jlong self,jlong queryDescriptors_nativeObj,jlong trainDescriptors_nativeObj,jlong matches_mat_nativeObj,jlong mask_nativeObj)639 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_match_10
640 (JNIEnv* env, jclass , jlong self, jlong queryDescriptors_nativeObj, jlong trainDescriptors_nativeObj, jlong matches_mat_nativeObj, jlong mask_nativeObj)
641 {
642 static const char method_name[] = "features2d::match_10()";
643 try {
644 LOGD("%s", method_name);
645 std::vector<DMatch> matches;
646 Mat& matches_mat = *((Mat*)matches_mat_nativeObj);
647 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
648 Mat& queryDescriptors = *((Mat*)queryDescriptors_nativeObj);
649 Mat& trainDescriptors = *((Mat*)trainDescriptors_nativeObj);
650 Mat& mask = *((Mat*)mask_nativeObj);
651 me->match( queryDescriptors, trainDescriptors, matches, mask );
652 vector_DMatch_to_Mat( matches, matches_mat );
653 return;
654 } catch(const std::exception &e) {
655 throwJavaException(env, &e, method_name);
656 } catch (...) {
657 throwJavaException(env, 0, method_name);
658 }
659 return;
660 }
661
662
663
664 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_match_11 (JNIEnv*, jclass, jlong, jlong, jlong, jlong);
665
Java_org_opencv_features2d_DescriptorMatcher_match_11(JNIEnv * env,jclass,jlong self,jlong queryDescriptors_nativeObj,jlong trainDescriptors_nativeObj,jlong matches_mat_nativeObj)666 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_match_11
667 (JNIEnv* env, jclass , jlong self, jlong queryDescriptors_nativeObj, jlong trainDescriptors_nativeObj, jlong matches_mat_nativeObj)
668 {
669 static const char method_name[] = "features2d::match_11()";
670 try {
671 LOGD("%s", method_name);
672 std::vector<DMatch> matches;
673 Mat& matches_mat = *((Mat*)matches_mat_nativeObj);
674 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
675 Mat& queryDescriptors = *((Mat*)queryDescriptors_nativeObj);
676 Mat& trainDescriptors = *((Mat*)trainDescriptors_nativeObj);
677 me->match( queryDescriptors, trainDescriptors, matches );
678 vector_DMatch_to_Mat( matches, matches_mat );
679 return;
680 } catch(const std::exception &e) {
681 throwJavaException(env, &e, method_name);
682 } catch (...) {
683 throwJavaException(env, 0, method_name);
684 }
685 return;
686 }
687
688
689
690 //
691 // void knnMatch(Mat queryDescriptors, Mat trainDescriptors, vector_vector_DMatch& matches, int k, Mat mask = Mat(), bool compactResult = false)
692 //
693
694 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_knnMatch_10 (JNIEnv*, jclass, jlong, jlong, jlong, jlong, jint, jlong, jboolean);
695
Java_org_opencv_features2d_DescriptorMatcher_knnMatch_10(JNIEnv * env,jclass,jlong self,jlong queryDescriptors_nativeObj,jlong trainDescriptors_nativeObj,jlong matches_mat_nativeObj,jint k,jlong mask_nativeObj,jboolean compactResult)696 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_knnMatch_10
697 (JNIEnv* env, jclass , jlong self, jlong queryDescriptors_nativeObj, jlong trainDescriptors_nativeObj, jlong matches_mat_nativeObj, jint k, jlong mask_nativeObj, jboolean compactResult)
698 {
699 static const char method_name[] = "features2d::knnMatch_10()";
700 try {
701 LOGD("%s", method_name);
702 std::vector< std::vector<DMatch> > matches;
703 Mat& matches_mat = *((Mat*)matches_mat_nativeObj);
704 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
705 Mat& queryDescriptors = *((Mat*)queryDescriptors_nativeObj);
706 Mat& trainDescriptors = *((Mat*)trainDescriptors_nativeObj);
707 Mat& mask = *((Mat*)mask_nativeObj);
708 me->knnMatch( queryDescriptors, trainDescriptors, matches, (int)k, mask, (bool)compactResult );
709 vector_vector_DMatch_to_Mat( matches, matches_mat );
710 return;
711 } catch(const std::exception &e) {
712 throwJavaException(env, &e, method_name);
713 } catch (...) {
714 throwJavaException(env, 0, method_name);
715 }
716 return;
717 }
718
719
720
721 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_knnMatch_11 (JNIEnv*, jclass, jlong, jlong, jlong, jlong, jint);
722
Java_org_opencv_features2d_DescriptorMatcher_knnMatch_11(JNIEnv * env,jclass,jlong self,jlong queryDescriptors_nativeObj,jlong trainDescriptors_nativeObj,jlong matches_mat_nativeObj,jint k)723 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_knnMatch_11
724 (JNIEnv* env, jclass , jlong self, jlong queryDescriptors_nativeObj, jlong trainDescriptors_nativeObj, jlong matches_mat_nativeObj, jint k)
725 {
726 static const char method_name[] = "features2d::knnMatch_11()";
727 try {
728 LOGD("%s", method_name);
729 std::vector< std::vector<DMatch> > matches;
730 Mat& matches_mat = *((Mat*)matches_mat_nativeObj);
731 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
732 Mat& queryDescriptors = *((Mat*)queryDescriptors_nativeObj);
733 Mat& trainDescriptors = *((Mat*)trainDescriptors_nativeObj);
734 me->knnMatch( queryDescriptors, trainDescriptors, matches, (int)k );
735 vector_vector_DMatch_to_Mat( matches, matches_mat );
736 return;
737 } catch(const std::exception &e) {
738 throwJavaException(env, &e, method_name);
739 } catch (...) {
740 throwJavaException(env, 0, method_name);
741 }
742 return;
743 }
744
745
746
747 //
748 // void radiusMatch(Mat queryDescriptors, Mat trainDescriptors, vector_vector_DMatch& matches, float maxDistance, Mat mask = Mat(), bool compactResult = false)
749 //
750
751 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_radiusMatch_10 (JNIEnv*, jclass, jlong, jlong, jlong, jlong, jfloat, jlong, jboolean);
752
Java_org_opencv_features2d_DescriptorMatcher_radiusMatch_10(JNIEnv * env,jclass,jlong self,jlong queryDescriptors_nativeObj,jlong trainDescriptors_nativeObj,jlong matches_mat_nativeObj,jfloat maxDistance,jlong mask_nativeObj,jboolean compactResult)753 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_radiusMatch_10
754 (JNIEnv* env, jclass , jlong self, jlong queryDescriptors_nativeObj, jlong trainDescriptors_nativeObj, jlong matches_mat_nativeObj, jfloat maxDistance, jlong mask_nativeObj, jboolean compactResult)
755 {
756 static const char method_name[] = "features2d::radiusMatch_10()";
757 try {
758 LOGD("%s", method_name);
759 std::vector< std::vector<DMatch> > matches;
760 Mat& matches_mat = *((Mat*)matches_mat_nativeObj);
761 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
762 Mat& queryDescriptors = *((Mat*)queryDescriptors_nativeObj);
763 Mat& trainDescriptors = *((Mat*)trainDescriptors_nativeObj);
764 Mat& mask = *((Mat*)mask_nativeObj);
765 me->radiusMatch( queryDescriptors, trainDescriptors, matches, (float)maxDistance, mask, (bool)compactResult );
766 vector_vector_DMatch_to_Mat( matches, matches_mat );
767 return;
768 } catch(const std::exception &e) {
769 throwJavaException(env, &e, method_name);
770 } catch (...) {
771 throwJavaException(env, 0, method_name);
772 }
773 return;
774 }
775
776
777
778 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_radiusMatch_11 (JNIEnv*, jclass, jlong, jlong, jlong, jlong, jfloat);
779
Java_org_opencv_features2d_DescriptorMatcher_radiusMatch_11(JNIEnv * env,jclass,jlong self,jlong queryDescriptors_nativeObj,jlong trainDescriptors_nativeObj,jlong matches_mat_nativeObj,jfloat maxDistance)780 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_radiusMatch_11
781 (JNIEnv* env, jclass , jlong self, jlong queryDescriptors_nativeObj, jlong trainDescriptors_nativeObj, jlong matches_mat_nativeObj, jfloat maxDistance)
782 {
783 static const char method_name[] = "features2d::radiusMatch_11()";
784 try {
785 LOGD("%s", method_name);
786 std::vector< std::vector<DMatch> > matches;
787 Mat& matches_mat = *((Mat*)matches_mat_nativeObj);
788 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
789 Mat& queryDescriptors = *((Mat*)queryDescriptors_nativeObj);
790 Mat& trainDescriptors = *((Mat*)trainDescriptors_nativeObj);
791 me->radiusMatch( queryDescriptors, trainDescriptors, matches, (float)maxDistance );
792 vector_vector_DMatch_to_Mat( matches, matches_mat );
793 return;
794 } catch(const std::exception &e) {
795 throwJavaException(env, &e, method_name);
796 } catch (...) {
797 throwJavaException(env, 0, method_name);
798 }
799 return;
800 }
801
802
803
804 //
805 // void match(Mat queryDescriptors, vector_DMatch& matches, vector_Mat masks = std::vector<Mat>())
806 //
807
808 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_match_12 (JNIEnv*, jclass, jlong, jlong, jlong, jlong);
809
Java_org_opencv_features2d_DescriptorMatcher_match_12(JNIEnv * env,jclass,jlong self,jlong queryDescriptors_nativeObj,jlong matches_mat_nativeObj,jlong masks_mat_nativeObj)810 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_match_12
811 (JNIEnv* env, jclass , jlong self, jlong queryDescriptors_nativeObj, jlong matches_mat_nativeObj, jlong masks_mat_nativeObj)
812 {
813 static const char method_name[] = "features2d::match_12()";
814 try {
815 LOGD("%s", method_name);
816 std::vector<DMatch> matches;
817 Mat& matches_mat = *((Mat*)matches_mat_nativeObj);
818 std::vector<Mat> masks;
819 Mat& masks_mat = *((Mat*)masks_mat_nativeObj);
820 Mat_to_vector_Mat( masks_mat, masks );
821 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
822 Mat& queryDescriptors = *((Mat*)queryDescriptors_nativeObj);
823 me->match( queryDescriptors, matches, masks );
824 vector_DMatch_to_Mat( matches, matches_mat );
825 return;
826 } catch(const std::exception &e) {
827 throwJavaException(env, &e, method_name);
828 } catch (...) {
829 throwJavaException(env, 0, method_name);
830 }
831 return;
832 }
833
834
835
836 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_match_13 (JNIEnv*, jclass, jlong, jlong, jlong);
837
Java_org_opencv_features2d_DescriptorMatcher_match_13(JNIEnv * env,jclass,jlong self,jlong queryDescriptors_nativeObj,jlong matches_mat_nativeObj)838 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_match_13
839 (JNIEnv* env, jclass , jlong self, jlong queryDescriptors_nativeObj, jlong matches_mat_nativeObj)
840 {
841 static const char method_name[] = "features2d::match_13()";
842 try {
843 LOGD("%s", method_name);
844 std::vector<DMatch> matches;
845 Mat& matches_mat = *((Mat*)matches_mat_nativeObj);
846 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
847 Mat& queryDescriptors = *((Mat*)queryDescriptors_nativeObj);
848 me->match( queryDescriptors, matches );
849 vector_DMatch_to_Mat( matches, matches_mat );
850 return;
851 } catch(const std::exception &e) {
852 throwJavaException(env, &e, method_name);
853 } catch (...) {
854 throwJavaException(env, 0, method_name);
855 }
856 return;
857 }
858
859
860
861 //
862 // void knnMatch(Mat queryDescriptors, vector_vector_DMatch& matches, int k, vector_Mat masks = std::vector<Mat>(), bool compactResult = false)
863 //
864
865 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_knnMatch_12 (JNIEnv*, jclass, jlong, jlong, jlong, jint, jlong, jboolean);
866
Java_org_opencv_features2d_DescriptorMatcher_knnMatch_12(JNIEnv * env,jclass,jlong self,jlong queryDescriptors_nativeObj,jlong matches_mat_nativeObj,jint k,jlong masks_mat_nativeObj,jboolean compactResult)867 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_knnMatch_12
868 (JNIEnv* env, jclass , jlong self, jlong queryDescriptors_nativeObj, jlong matches_mat_nativeObj, jint k, jlong masks_mat_nativeObj, jboolean compactResult)
869 {
870 static const char method_name[] = "features2d::knnMatch_12()";
871 try {
872 LOGD("%s", method_name);
873 std::vector< std::vector<DMatch> > matches;
874 Mat& matches_mat = *((Mat*)matches_mat_nativeObj);
875 std::vector<Mat> masks;
876 Mat& masks_mat = *((Mat*)masks_mat_nativeObj);
877 Mat_to_vector_Mat( masks_mat, masks );
878 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
879 Mat& queryDescriptors = *((Mat*)queryDescriptors_nativeObj);
880 me->knnMatch( queryDescriptors, matches, (int)k, masks, (bool)compactResult );
881 vector_vector_DMatch_to_Mat( matches, matches_mat );
882 return;
883 } catch(const std::exception &e) {
884 throwJavaException(env, &e, method_name);
885 } catch (...) {
886 throwJavaException(env, 0, method_name);
887 }
888 return;
889 }
890
891
892
893 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_knnMatch_13 (JNIEnv*, jclass, jlong, jlong, jlong, jint);
894
Java_org_opencv_features2d_DescriptorMatcher_knnMatch_13(JNIEnv * env,jclass,jlong self,jlong queryDescriptors_nativeObj,jlong matches_mat_nativeObj,jint k)895 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_knnMatch_13
896 (JNIEnv* env, jclass , jlong self, jlong queryDescriptors_nativeObj, jlong matches_mat_nativeObj, jint k)
897 {
898 static const char method_name[] = "features2d::knnMatch_13()";
899 try {
900 LOGD("%s", method_name);
901 std::vector< std::vector<DMatch> > matches;
902 Mat& matches_mat = *((Mat*)matches_mat_nativeObj);
903 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
904 Mat& queryDescriptors = *((Mat*)queryDescriptors_nativeObj);
905 me->knnMatch( queryDescriptors, matches, (int)k );
906 vector_vector_DMatch_to_Mat( matches, matches_mat );
907 return;
908 } catch(const std::exception &e) {
909 throwJavaException(env, &e, method_name);
910 } catch (...) {
911 throwJavaException(env, 0, method_name);
912 }
913 return;
914 }
915
916
917
918 //
919 // void radiusMatch(Mat queryDescriptors, vector_vector_DMatch& matches, float maxDistance, vector_Mat masks = std::vector<Mat>(), bool compactResult = false)
920 //
921
922 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_radiusMatch_12 (JNIEnv*, jclass, jlong, jlong, jlong, jfloat, jlong, jboolean);
923
Java_org_opencv_features2d_DescriptorMatcher_radiusMatch_12(JNIEnv * env,jclass,jlong self,jlong queryDescriptors_nativeObj,jlong matches_mat_nativeObj,jfloat maxDistance,jlong masks_mat_nativeObj,jboolean compactResult)924 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_radiusMatch_12
925 (JNIEnv* env, jclass , jlong self, jlong queryDescriptors_nativeObj, jlong matches_mat_nativeObj, jfloat maxDistance, jlong masks_mat_nativeObj, jboolean compactResult)
926 {
927 static const char method_name[] = "features2d::radiusMatch_12()";
928 try {
929 LOGD("%s", method_name);
930 std::vector< std::vector<DMatch> > matches;
931 Mat& matches_mat = *((Mat*)matches_mat_nativeObj);
932 std::vector<Mat> masks;
933 Mat& masks_mat = *((Mat*)masks_mat_nativeObj);
934 Mat_to_vector_Mat( masks_mat, masks );
935 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
936 Mat& queryDescriptors = *((Mat*)queryDescriptors_nativeObj);
937 me->radiusMatch( queryDescriptors, matches, (float)maxDistance, masks, (bool)compactResult );
938 vector_vector_DMatch_to_Mat( matches, matches_mat );
939 return;
940 } catch(const std::exception &e) {
941 throwJavaException(env, &e, method_name);
942 } catch (...) {
943 throwJavaException(env, 0, method_name);
944 }
945 return;
946 }
947
948
949
950 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_radiusMatch_13 (JNIEnv*, jclass, jlong, jlong, jlong, jfloat);
951
Java_org_opencv_features2d_DescriptorMatcher_radiusMatch_13(JNIEnv * env,jclass,jlong self,jlong queryDescriptors_nativeObj,jlong matches_mat_nativeObj,jfloat maxDistance)952 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_radiusMatch_13
953 (JNIEnv* env, jclass , jlong self, jlong queryDescriptors_nativeObj, jlong matches_mat_nativeObj, jfloat maxDistance)
954 {
955 static const char method_name[] = "features2d::radiusMatch_13()";
956 try {
957 LOGD("%s", method_name);
958 std::vector< std::vector<DMatch> > matches;
959 Mat& matches_mat = *((Mat*)matches_mat_nativeObj);
960 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
961 Mat& queryDescriptors = *((Mat*)queryDescriptors_nativeObj);
962 me->radiusMatch( queryDescriptors, matches, (float)maxDistance );
963 vector_vector_DMatch_to_Mat( matches, matches_mat );
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 // javaDescriptorMatcher* jclone(bool emptyTrainData = false)
977 //
978
979 JNIEXPORT jlong JNICALL Java_org_opencv_features2d_DescriptorMatcher_clone_10 (JNIEnv*, jclass, jlong, jboolean);
980
Java_org_opencv_features2d_DescriptorMatcher_clone_10(JNIEnv * env,jclass,jlong self,jboolean emptyTrainData)981 JNIEXPORT jlong JNICALL Java_org_opencv_features2d_DescriptorMatcher_clone_10
982 (JNIEnv* env, jclass , jlong self, jboolean emptyTrainData)
983 {
984 static const char method_name[] = "features2d::clone_10()";
985 try {
986 LOGD("%s", method_name);
987 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
988 javaDescriptorMatcher* _retval_ = me->jclone( (bool)emptyTrainData );
989 return (jlong) _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 JNIEXPORT jlong JNICALL Java_org_opencv_features2d_DescriptorMatcher_clone_11 (JNIEnv*, jclass, jlong);
1001
Java_org_opencv_features2d_DescriptorMatcher_clone_11(JNIEnv * env,jclass,jlong self)1002 JNIEXPORT jlong JNICALL Java_org_opencv_features2d_DescriptorMatcher_clone_11
1003 (JNIEnv* env, jclass , jlong self)
1004 {
1005 static const char method_name[] = "features2d::clone_11()";
1006 try {
1007 LOGD("%s", method_name);
1008 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
1009 javaDescriptorMatcher* _retval_ = me->jclone( );
1010 return (jlong) _retval_;
1011 } catch(const std::exception &e) {
1012 throwJavaException(env, &e, method_name);
1013 } catch (...) {
1014 throwJavaException(env, 0, method_name);
1015 }
1016 return 0;
1017 }
1018
1019
1020
1021 //
1022 // static javaDescriptorMatcher* create(int matcherType)
1023 //
1024
1025 JNIEXPORT jlong JNICALL Java_org_opencv_features2d_DescriptorMatcher_create_10 (JNIEnv*, jclass, jint);
1026
Java_org_opencv_features2d_DescriptorMatcher_create_10(JNIEnv * env,jclass,jint matcherType)1027 JNIEXPORT jlong JNICALL Java_org_opencv_features2d_DescriptorMatcher_create_10
1028 (JNIEnv* env, jclass , jint matcherType)
1029 {
1030 static const char method_name[] = "features2d::create_10()";
1031 try {
1032 LOGD("%s", method_name);
1033
1034 javaDescriptorMatcher* _retval_ = cv::javaDescriptorMatcher::create( (int)matcherType );
1035 return (jlong) _retval_;
1036 } catch(const std::exception &e) {
1037 throwJavaException(env, &e, method_name);
1038 } catch (...) {
1039 throwJavaException(env, 0, method_name);
1040 }
1041 return 0;
1042 }
1043
1044
1045
1046 //
1047 // void write(String fileName)
1048 //
1049
1050 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_write_10 (JNIEnv*, jclass, jlong, jstring);
1051
Java_org_opencv_features2d_DescriptorMatcher_write_10(JNIEnv * env,jclass,jlong self,jstring fileName)1052 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_write_10
1053 (JNIEnv* env, jclass , jlong self, jstring fileName)
1054 {
1055 static const char method_name[] = "features2d::write_10()";
1056 try {
1057 LOGD("%s", method_name);
1058 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
1059 const char* utf_fileName = env->GetStringUTFChars(fileName, 0); String n_fileName( utf_fileName ? utf_fileName : "" ); env->ReleaseStringUTFChars(fileName, utf_fileName);
1060 me->write( n_fileName );
1061 return;
1062 } catch(const std::exception &e) {
1063 throwJavaException(env, &e, method_name);
1064 } catch (...) {
1065 throwJavaException(env, 0, method_name);
1066 }
1067 return;
1068 }
1069
1070
1071
1072 //
1073 // void read(String fileName)
1074 //
1075
1076 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_read_10 (JNIEnv*, jclass, jlong, jstring);
1077
Java_org_opencv_features2d_DescriptorMatcher_read_10(JNIEnv * env,jclass,jlong self,jstring fileName)1078 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_read_10
1079 (JNIEnv* env, jclass , jlong self, jstring fileName)
1080 {
1081 static const char method_name[] = "features2d::read_10()";
1082 try {
1083 LOGD("%s", method_name);
1084 cv::javaDescriptorMatcher* me = (cv::javaDescriptorMatcher*) self; //TODO: check for NULL
1085 const char* utf_fileName = env->GetStringUTFChars(fileName, 0); String n_fileName( utf_fileName ? utf_fileName : "" ); env->ReleaseStringUTFChars(fileName, utf_fileName);
1086 me->read( n_fileName );
1087 return;
1088 } catch(const std::exception &e) {
1089 throwJavaException(env, &e, method_name);
1090 } catch (...) {
1091 throwJavaException(env, 0, method_name);
1092 }
1093 return;
1094 }
1095
1096
1097
1098 //
1099 // native support for java finalize()
1100 // static void cv::javaDescriptorMatcher::delete( __int64 self )
1101 //
1102 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_delete(JNIEnv*, jclass, jlong);
1103
Java_org_opencv_features2d_DescriptorMatcher_delete(JNIEnv *,jclass,jlong self)1104 JNIEXPORT void JNICALL Java_org_opencv_features2d_DescriptorMatcher_delete
1105 (JNIEnv*, jclass, jlong self)
1106 {
1107 delete (cv::javaDescriptorMatcher*) self;
1108 }
1109
1110
1111 //
1112 // void detect(Mat image, vector_KeyPoint& keypoints, Mat mask = Mat())
1113 //
1114
1115 JNIEXPORT void JNICALL Java_org_opencv_features2d_FeatureDetector_detect_10 (JNIEnv*, jclass, jlong, jlong, jlong, jlong);
1116
Java_org_opencv_features2d_FeatureDetector_detect_10(JNIEnv * env,jclass,jlong self,jlong image_nativeObj,jlong keypoints_mat_nativeObj,jlong mask_nativeObj)1117 JNIEXPORT void JNICALL Java_org_opencv_features2d_FeatureDetector_detect_10
1118 (JNIEnv* env, jclass , jlong self, jlong image_nativeObj, jlong keypoints_mat_nativeObj, jlong mask_nativeObj)
1119 {
1120 static const char method_name[] = "features2d::detect_10()";
1121 try {
1122 LOGD("%s", method_name);
1123 std::vector<KeyPoint> keypoints;
1124 Mat& keypoints_mat = *((Mat*)keypoints_mat_nativeObj);
1125 cv::javaFeatureDetector* me = (cv::javaFeatureDetector*) self; //TODO: check for NULL
1126 Mat& image = *((Mat*)image_nativeObj);
1127 Mat& mask = *((Mat*)mask_nativeObj);
1128 me->detect( image, keypoints, mask );
1129 vector_KeyPoint_to_Mat( keypoints, keypoints_mat );
1130 return;
1131 } catch(const std::exception &e) {
1132 throwJavaException(env, &e, method_name);
1133 } catch (...) {
1134 throwJavaException(env, 0, method_name);
1135 }
1136 return;
1137 }
1138
1139
1140
1141 JNIEXPORT void JNICALL Java_org_opencv_features2d_FeatureDetector_detect_11 (JNIEnv*, jclass, jlong, jlong, jlong);
1142
Java_org_opencv_features2d_FeatureDetector_detect_11(JNIEnv * env,jclass,jlong self,jlong image_nativeObj,jlong keypoints_mat_nativeObj)1143 JNIEXPORT void JNICALL Java_org_opencv_features2d_FeatureDetector_detect_11
1144 (JNIEnv* env, jclass , jlong self, jlong image_nativeObj, jlong keypoints_mat_nativeObj)
1145 {
1146 static const char method_name[] = "features2d::detect_11()";
1147 try {
1148 LOGD("%s", method_name);
1149 std::vector<KeyPoint> keypoints;
1150 Mat& keypoints_mat = *((Mat*)keypoints_mat_nativeObj);
1151 cv::javaFeatureDetector* me = (cv::javaFeatureDetector*) self; //TODO: check for NULL
1152 Mat& image = *((Mat*)image_nativeObj);
1153 me->detect( image, keypoints );
1154 vector_KeyPoint_to_Mat( keypoints, keypoints_mat );
1155 return;
1156 } catch(const std::exception &e) {
1157 throwJavaException(env, &e, method_name);
1158 } catch (...) {
1159 throwJavaException(env, 0, method_name);
1160 }
1161 return;
1162 }
1163
1164
1165
1166 //
1167 // void detect(vector_Mat images, vector_vector_KeyPoint& keypoints, vector_Mat masks = std::vector<Mat>())
1168 //
1169
1170 JNIEXPORT void JNICALL Java_org_opencv_features2d_FeatureDetector_detect_12 (JNIEnv*, jclass, jlong, jlong, jlong, jlong);
1171
Java_org_opencv_features2d_FeatureDetector_detect_12(JNIEnv * env,jclass,jlong self,jlong images_mat_nativeObj,jlong keypoints_mat_nativeObj,jlong masks_mat_nativeObj)1172 JNIEXPORT void JNICALL Java_org_opencv_features2d_FeatureDetector_detect_12
1173 (JNIEnv* env, jclass , jlong self, jlong images_mat_nativeObj, jlong keypoints_mat_nativeObj, jlong masks_mat_nativeObj)
1174 {
1175 static const char method_name[] = "features2d::detect_12()";
1176 try {
1177 LOGD("%s", method_name);
1178 std::vector<Mat> images;
1179 Mat& images_mat = *((Mat*)images_mat_nativeObj);
1180 Mat_to_vector_Mat( images_mat, images );
1181 std::vector< std::vector<KeyPoint> > keypoints;
1182 Mat& keypoints_mat = *((Mat*)keypoints_mat_nativeObj);
1183 std::vector<Mat> masks;
1184 Mat& masks_mat = *((Mat*)masks_mat_nativeObj);
1185 Mat_to_vector_Mat( masks_mat, masks );
1186 cv::javaFeatureDetector* me = (cv::javaFeatureDetector*) self; //TODO: check for NULL
1187 me->detect( images, keypoints, masks );
1188 vector_vector_KeyPoint_to_Mat( keypoints, keypoints_mat );
1189 return;
1190 } catch(const std::exception &e) {
1191 throwJavaException(env, &e, method_name);
1192 } catch (...) {
1193 throwJavaException(env, 0, method_name);
1194 }
1195 return;
1196 }
1197
1198
1199
1200 JNIEXPORT void JNICALL Java_org_opencv_features2d_FeatureDetector_detect_13 (JNIEnv*, jclass, jlong, jlong, jlong);
1201
Java_org_opencv_features2d_FeatureDetector_detect_13(JNIEnv * env,jclass,jlong self,jlong images_mat_nativeObj,jlong keypoints_mat_nativeObj)1202 JNIEXPORT void JNICALL Java_org_opencv_features2d_FeatureDetector_detect_13
1203 (JNIEnv* env, jclass , jlong self, jlong images_mat_nativeObj, jlong keypoints_mat_nativeObj)
1204 {
1205 static const char method_name[] = "features2d::detect_13()";
1206 try {
1207 LOGD("%s", method_name);
1208 std::vector<Mat> images;
1209 Mat& images_mat = *((Mat*)images_mat_nativeObj);
1210 Mat_to_vector_Mat( images_mat, images );
1211 std::vector< std::vector<KeyPoint> > keypoints;
1212 Mat& keypoints_mat = *((Mat*)keypoints_mat_nativeObj);
1213 cv::javaFeatureDetector* me = (cv::javaFeatureDetector*) self; //TODO: check for NULL
1214 me->detect( images, keypoints );
1215 vector_vector_KeyPoint_to_Mat( keypoints, keypoints_mat );
1216 return;
1217 } catch(const std::exception &e) {
1218 throwJavaException(env, &e, method_name);
1219 } catch (...) {
1220 throwJavaException(env, 0, method_name);
1221 }
1222 return;
1223 }
1224
1225
1226
1227 //
1228 // bool empty()
1229 //
1230
1231 JNIEXPORT jboolean JNICALL Java_org_opencv_features2d_FeatureDetector_empty_10 (JNIEnv*, jclass, jlong);
1232
Java_org_opencv_features2d_FeatureDetector_empty_10(JNIEnv * env,jclass,jlong self)1233 JNIEXPORT jboolean JNICALL Java_org_opencv_features2d_FeatureDetector_empty_10
1234 (JNIEnv* env, jclass , jlong self)
1235 {
1236 static const char method_name[] = "features2d::empty_10()";
1237 try {
1238 LOGD("%s", method_name);
1239 cv::javaFeatureDetector* me = (cv::javaFeatureDetector*) self; //TODO: check for NULL
1240 bool _retval_ = me->empty( );
1241 return _retval_;
1242 } catch(const std::exception &e) {
1243 throwJavaException(env, &e, method_name);
1244 } catch (...) {
1245 throwJavaException(env, 0, method_name);
1246 }
1247 return 0;
1248 }
1249
1250
1251
1252 //
1253 // static javaFeatureDetector* create(int detectorType)
1254 //
1255
1256 JNIEXPORT jlong JNICALL Java_org_opencv_features2d_FeatureDetector_create_10 (JNIEnv*, jclass, jint);
1257
Java_org_opencv_features2d_FeatureDetector_create_10(JNIEnv * env,jclass,jint detectorType)1258 JNIEXPORT jlong JNICALL Java_org_opencv_features2d_FeatureDetector_create_10
1259 (JNIEnv* env, jclass , jint detectorType)
1260 {
1261 static const char method_name[] = "features2d::create_10()";
1262 try {
1263 LOGD("%s", method_name);
1264
1265 javaFeatureDetector* _retval_ = cv::javaFeatureDetector::create( (int)detectorType );
1266 return (jlong) _retval_;
1267 } catch(const std::exception &e) {
1268 throwJavaException(env, &e, method_name);
1269 } catch (...) {
1270 throwJavaException(env, 0, method_name);
1271 }
1272 return 0;
1273 }
1274
1275
1276
1277 //
1278 // void write(String fileName)
1279 //
1280
1281 JNIEXPORT void JNICALL Java_org_opencv_features2d_FeatureDetector_write_10 (JNIEnv*, jclass, jlong, jstring);
1282
Java_org_opencv_features2d_FeatureDetector_write_10(JNIEnv * env,jclass,jlong self,jstring fileName)1283 JNIEXPORT void JNICALL Java_org_opencv_features2d_FeatureDetector_write_10
1284 (JNIEnv* env, jclass , jlong self, jstring fileName)
1285 {
1286 static const char method_name[] = "features2d::write_10()";
1287 try {
1288 LOGD("%s", method_name);
1289 cv::javaFeatureDetector* me = (cv::javaFeatureDetector*) self; //TODO: check for NULL
1290 const char* utf_fileName = env->GetStringUTFChars(fileName, 0); String n_fileName( utf_fileName ? utf_fileName : "" ); env->ReleaseStringUTFChars(fileName, utf_fileName);
1291 me->write( n_fileName );
1292 return;
1293 } catch(const std::exception &e) {
1294 throwJavaException(env, &e, method_name);
1295 } catch (...) {
1296 throwJavaException(env, 0, method_name);
1297 }
1298 return;
1299 }
1300
1301
1302
1303 //
1304 // void read(String fileName)
1305 //
1306
1307 JNIEXPORT void JNICALL Java_org_opencv_features2d_FeatureDetector_read_10 (JNIEnv*, jclass, jlong, jstring);
1308
Java_org_opencv_features2d_FeatureDetector_read_10(JNIEnv * env,jclass,jlong self,jstring fileName)1309 JNIEXPORT void JNICALL Java_org_opencv_features2d_FeatureDetector_read_10
1310 (JNIEnv* env, jclass , jlong self, jstring fileName)
1311 {
1312 static const char method_name[] = "features2d::read_10()";
1313 try {
1314 LOGD("%s", method_name);
1315 cv::javaFeatureDetector* me = (cv::javaFeatureDetector*) self; //TODO: check for NULL
1316 const char* utf_fileName = env->GetStringUTFChars(fileName, 0); String n_fileName( utf_fileName ? utf_fileName : "" ); env->ReleaseStringUTFChars(fileName, utf_fileName);
1317 me->read( n_fileName );
1318 return;
1319 } catch(const std::exception &e) {
1320 throwJavaException(env, &e, method_name);
1321 } catch (...) {
1322 throwJavaException(env, 0, method_name);
1323 }
1324 return;
1325 }
1326
1327
1328
1329 //
1330 // native support for java finalize()
1331 // static void cv::javaFeatureDetector::delete( __int64 self )
1332 //
1333 JNIEXPORT void JNICALL Java_org_opencv_features2d_FeatureDetector_delete(JNIEnv*, jclass, jlong);
1334
Java_org_opencv_features2d_FeatureDetector_delete(JNIEnv *,jclass,jlong self)1335 JNIEXPORT void JNICALL Java_org_opencv_features2d_FeatureDetector_delete
1336 (JNIEnv*, jclass, jlong self)
1337 {
1338 delete (cv::javaFeatureDetector*) self;
1339 }
1340
1341
1342
1343 } // extern "C"
1344
1345 #endif // HAVE_OPENCV_FEATURES2D
1346