Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
gen_dict.json
1{
2 "ManualFuncs": {
3 "VpDetectorAprilTag": {
4 "detect": {
5 "j_code": [
6 "//",
7 "// manual port",
8 "// C++: bool detect(vpImage_char I, double tagSize, vpCameraParameters cam, vector_vpHomogeneousMatrix cMo_vec)",
9 "//\n",
10 "//javadoc: VpDetectorAprilTag::detect(I, tagSize, cam, cMo_vec_list_arr)\n",
11 "public java.util.List<org.visp.core.VpHomogeneousMatrix> detect(org.visp.core.VpImageUChar I, double tagSize, org.visp.core.VpCameraParameters cam)",
12 "{",
13 " long[] arr = detect_0(nativeObj, I.nativeObj, tagSize, cam.nativeObj);",
14 " return org.visp.utils.Converters.Array_to_vector_vpHomogeneousMatrix(arr);",
15 "}\n\n",
16 "//",
17 "// manual port",
18 "// C++: bool detect(vpImage_char I)",
19 "//\n",
20 "//javadoc: VpDetectorAprilTag::detect(I)\n",
21 "public boolean detect(org.visp.core.VpImageUChar I)",
22 "{",
23 " boolean retVal = detect_1(nativeObj, I.nativeObj);",
24 " return retVal;",
25 "}"
26 ],
27 "cpp_code": [
28 "//",
29 "// bool detect(vpImage_char I, double tagSize, vpCameraParameters cam, vector_vpHomogeneousMatrix cMo_vec)",
30 "//\n\n",
31 "JNIEXPORT jlongArray JNICALL Java_org_visp_detection_VpDetectorAprilTag_detect_10 (JNIEnv*, jclass, jlong, jlong, jdouble, jlong);\n",
32 "JNIEXPORT jlongArray JNICALL Java_org_visp_detection_VpDetectorAprilTag_detect_10",
33 " (JNIEnv* env, jclass , jlong self, jlong I_nativeObj, jdouble tagSize, jlong cam_nativeObj)",
34 "{",
35 " static const char method_name[] = \"detection::detect_10()\";",
36 " try {",
37 " LOGD(\"%s\", method_name);",
38 " std::vector<vpHomogeneousMatrix> cMo_vec_list_arr;",
39 " vpDetectorAprilTag* me = (vpDetectorAprilTag*) self; //TODO: check for nullptr",
40 " vpImage<unsigned char>& I = *((vpImage<unsigned char>*)I_nativeObj);",
41 " vpCameraParameters& cam = *((vpCameraParameters*)cam_nativeObj);",
42 " /* bool _retval_ = */ me->detect( I, (double)tagSize, cam, cMo_vec_list_arr );",
43 " return vector_vpHomogeneousMatrix_to_List(env,cMo_vec_list_arr);",
44 " } catch(const std::exception &e) {",
45 " throwJavaException(env, &e, method_name);",
46 " } catch (...) {",
47 " throwJavaException(env, 0, method_name);",
48 " }",
49 " return nullptr;",
50 "}\n\n",
51 "//",
52 "// manual port",
53 "// bool detect(vpImage_char I)",
54 "//\n\n",
55 "JNIEXPORT jboolean JNICALL Java_org_visp_detection_VpDetectorAprilTag_detect_11 (JNIEnv*, jclass, jlong, jlong);\n",
56 "JNIEXPORT jboolean JNICALL Java_org_visp_detection_VpDetectorAprilTag_detect_11",
57 " (JNIEnv* env, jclass , jlong self, jlong I_nativeObj)",
58 "{",
59 " static const char method_name[] = \"detection::detect_11()\";",
60 " try {",
61 " LOGD(\"%s\", method_name);",
62 " vpDetectorAprilTag* me = (vpDetectorAprilTag*) self; //TODO: check for nullptr",
63 " vpImage<unsigned char>& I = *((vpImage<unsigned char>*)I_nativeObj);",
64 " bool _retval_ = me->detect( I );",
65 " return _retval_;",
66 " } catch(const std::exception &e) {",
67 " throwJavaException(env, &e, method_name);",
68 " } catch (...) {",
69 " throwJavaException(env, 0, method_name);",
70 " }",
71 " return 0;",
72 "}"
73 ],
74 "jn_code": [
75 "// C++: bool detect(vpImage_char I, double tagSize, vpCameraParameters cam, vector_vpHomogeneousMatrix cMo_vec)",
76 "private static native long[] detect_0(long nativeObj, long I_nativeObj, double tagSize, long cam_nativeObj);\n",
77 "// C++: bool detect(vpImage_char I)",
78 "private static native boolean detect_1(long nativeObj, long I_nativeObj);"
79 ]
80 },
81 "getPoseEstimationMethod": {
82 "j_code": [
83 "//",
84 "// manual port",
85 "// C++: vpPoseEstimationMethod getPoseEstimationMethod()",
86 "//",
87 "//javadoc: VpDetectorAprilTag::getPoseEstimationMethod()\n",
88 "public int getPoseEstimationMethod()",
89 "{",
90 " return getPoseEstimationMethod(nativeObj);",
91 "}"
92 ],
93 "jn_code": [
94 "// C++: vpPoseEstimationMethod getPoseEstimationMethod()",
95 "private static native int getPoseEstimationMethod(long address);"
96 ],
97 "cpp_code": [
98 "//",
99 "// manual port",
100 "// int getPoseEstimationMethod()",
101 "//\n",
102 "JNIEXPORT jint JNICALL Java_org_visp_detection_VpDetectorAprilTag_getPoseEstimationMethod (JNIEnv*, jclass, jlong);\n",
103 "JNIEXPORT jint JNICALL Java_org_visp_detection_VpDetectorAprilTag_getPoseEstimationMethod",
104 " (JNIEnv* env, jclass , jlong address)",
105 "{",
106 " static const char method_name[] = \"detection::getPoseEstimationMethod()\";",
107 " try {",
108 " LOGD(\"%s\", method_name);",
109 " vpDetectorAprilTag *tag = (vpDetectorAprilTag*) address;",
110 " return (int) tag->getPoseEstimationMethod();",
111 " } catch(const std::exception &e) {",
112 " throwJavaException(env, &e, method_name);",
113 " } catch (...) {",
114 " throwJavaException(env, 0, method_name);",
115 " }",
116 " return 0;",
117 "}"
118 ]
119 },
120 "setAprilTagPoseEstimationMethod": {
121 "j_code": [
122 "//",
123 "// manual port",
124 "// C++: void setAprilTagPoseEstimationMethod(const vpPoseEstimationMethod &poseEstimationMethod)",
125 "//",
126 "//javadoc: VpDetectorAprilTag::setAprilTagPoseEstimationMethod(int vpPoseEstimationMethod)\n",
127 "public void setAprilTagPoseEstimationMethod(int vpPoseEstimationMethod)",
128 "{",
129 " setAprilTagPoseEstimationMethod(nativeObj,vpPoseEstimationMethod);",
130 "}"
131 ],
132 "jn_code": [
133 "// C++: void setAprilTagPoseEstimationMethod(const vpPoseEstimationMethod &poseEstimationMethod)",
134 "private static native void setAprilTagPoseEstimationMethod(long address, int value);"
135 ],
136 "cpp_code": [
137 "//",
138 "// manual port",
139 "// void setAprilTagPoseEstimationMethod(int vpPoseEstimationMethod)",
140 "//\n",
141 "JNIEXPORT void JNICALL Java_org_visp_detection_VpDetectorAprilTag_setAprilTagPoseEstimationMethod (JNIEnv*, jclass, jlong, jint);\n",
142 "JNIEXPORT void JNICALL Java_org_visp_detection_VpDetectorAprilTag_setAprilTagPoseEstimationMethod",
143 " (JNIEnv* env, jclass , jlong address, jint value)",
144 "{",
145 " static const char method_name[] = \"detection::setAprilTagPoseEstimationMethod()\";",
146 " try {",
147 " LOGD(\"%s\", method_name);",
148 " vpDetectorAprilTag *tag = (vpDetectorAprilTag*) address;",
149 " tag->setAprilTagPoseEstimationMethod(vpDetectorAprilTag::vpPoseEstimationMethod(value));",
150 " } catch(const std::exception &e) {",
151 " throwJavaException(env, &e, method_name);",
152 " } catch (...) {",
153 " throwJavaException(env, 0, method_name);",
154 " }",
155 " return;",
156 "}"
157 ]
158 },
159 "setAprilTagFamily": {
160 "j_code": [
161 "//",
162 "// manual port",
163 "// C++: void setAprilTagFamily(const vpAprilTagFamily &tagFamily)",
164 "//",
165 "//javadoc: VpDetectorAprilTag::setAprilTagFamily(int tagFamily)\n",
166 "public void setAprilTagFamily(int tagFamily)",
167 "{",
168 " setAprilTagFamily(nativeObj,tagFamily);",
169 "}"
170 ],
171 "jn_code": [
172 "// C++: void setAprilTagFamily(const vpAprilTagFamily &tagFamily)",
173 "private static native void setAprilTagFamily(long address, int value);"
174 ],
175 "cpp_code": [
176 "//",
177 "// manual port",
178 "// void setAprilTagFamily(int tagFamily)",
179 "//\n",
180 "JNIEXPORT void JNICALL Java_org_visp_detection_VpDetectorAprilTag_setAprilTagFamily (JNIEnv*, jclass, jlong, jint);\n",
181 "JNIEXPORT void JNICALL Java_org_visp_detection_VpDetectorAprilTag_setAprilTagFamily",
182 " (JNIEnv* env, jclass , jlong address, jint value)",
183 "{",
184 " static const char method_name[] = \"detection::setAprilTagFamily()\";",
185 " try {",
186 " LOGD(\"%s\", method_name);",
187 " vpDetectorAprilTag *tag = (vpDetectorAprilTag*) address;",
188 " tag->setAprilTagFamily(vpDetectorAprilTag::vpAprilTagFamily(value));",
189 " } catch(const std::exception &e) {",
190 " throwJavaException(env, &e, method_name);",
191 " } catch (...) {",
192 " throwJavaException(env, 0, method_name);",
193 " }",
194 " return;",
195 "}"
196 ]
197 },
198 "getTagsCorners": {
199 "j_code": [
200 "//",
201 "// manual port",
202 "// C++: std::vector<std::vector<vpImagePoint> > getTagsCorners()",
203 "//",
204 "//javadoc: VpDetectorAprilTag::getTagsCorners()\n",
205 "public java.util.List<java.util.List<org.visp.core.VpImagePoint>> getTagsCorners()",
206 "{",
207 " java.lang.Object[] matrix_ = getTagsCorners(nativeObj);",
208 " long[][] tags_corners = new long[matrix_.length][];",
209 " for (int idx = 0; idx < matrix_.length; idx++) {",
210 " tags_corners[idx] = (long[]) matrix_[idx];",
211 " }",
212 "",
213 " return org.visp.utils.Converters.Array_Array_to_vector_vector_vpImagePoint(tags_corners);",
214 "}"
215 ],
216 "jn_code": [
217 "// C++: std::vector<std::vector<vpImagePoint> > getTagsCorners()",
218 "private static native java.lang.Object[] getTagsCorners(long address);"
219 ],
220 "cpp_code": [
221 "//",
222 "// manual port",
223 "// std::vector<std::vector<vpImagePoint> > getTagsCorners()",
224 "//\n",
225 "JNIEXPORT jobjectArray JNICALL Java_org_visp_detection_VpDetectorAprilTag_getTagsCorners (JNIEnv*, jclass, jlong);\n",
226 "JNIEXPORT jobjectArray JNICALL Java_org_visp_detection_VpDetectorAprilTag_getTagsCorners",
227 " (JNIEnv* env, jclass , jlong address)",
228 "{",
229 " static const char method_name[] = \"detection::getTagsCorners()\";",
230 " try {",
231 " LOGD(\"%s\", method_name);",
232 " vpDetectorAprilTag *tag = (vpDetectorAprilTag*) address;",
233 " std::vector<std::vector<vpImagePoint> > tags_corners = tag->getTagsCorners();",
234 " return vector_vector_vpImagePoint_to_List(env, tags_corners);",
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 "getTagsDecisionMargin": {
245 "j_code": [
246 "//",
247 "// manual port",
248 "// C++: std::vector<float> getTagsDecisionMargin()",
249 "//",
250 "//javadoc: VpDetectorAprilTag::getTagsDecisionMargin()\n",
251 "public float[] getTagsDecisionMargin()",
252 "{",
253 " return getTagsDecisionMargin(nativeObj);",
254 "}"
255 ],
256 "jn_code": [
257 "// C++: std::vector<float> getTagsDecisionMargin()",
258 "private static native float[] getTagsDecisionMargin(long address);"
259 ],
260 "cpp_code": [
261 "//",
262 "// manual port",
263 "// std::vector<float> getTagsDecisionMargin()",
264 "//\n",
265 "JNIEXPORT jfloatArray JNICALL Java_org_visp_detection_VpDetectorAprilTag_getTagsDecisionMargin (JNIEnv*, jclass, jlong);\n",
266 "JNIEXPORT jfloatArray JNICALL Java_org_visp_detection_VpDetectorAprilTag_getTagsDecisionMargin",
267 " (JNIEnv* env, jclass, jlong self)",
268 "{",
269 " static const char method_name[] = \"detection::getTagsDecisionMargin()\";",
270 " try {",
271 " LOGD(\"%s\", method_name);",
272 " vpDetectorAprilTag *tag = (vpDetectorAprilTag*) self;",
273 " std::vector<float> tag_DMs = tag->getTagsDecisionMargin();",
274 " jfloatArray jDMs = env->NewFloatArray(tag_DMs.size());",
275 " jfloat *ptr_DMs = nullptr;",
276 " ptr_DMs = env->GetFloatArrayElements(jDMs, 0);",
277 " for (size_t i = 0; i < tag_DMs.size(); i++) {",
278 " ptr_DMs[i] = tag_DMs[i];",
279 " }",
280 " env->ReleaseFloatArrayElements(jDMs, ptr_DMs, 0);",
281 " return jDMs;",
282 " } catch(const std::exception &e) {",
283 " throwJavaException(env, &e, method_name);",
284 " } catch (...) {",
285 " throwJavaException(env, 0, method_name);",
286 " }",
287 " return 0;",
288 "}"
289 ]
290 },
291 "getTagsHammingDistance": {
292 "j_code": [
293 "//",
294 "// manual port",
295 "// C++: std::vector<int> getTagsHammingDistance()",
296 "//",
297 "//javadoc: VpDetectorAprilTag::getTagsHammingDistance()\n",
298 "public int[] getTagsHammingDistance()",
299 "{",
300 " return getTagsHammingDistance(nativeObj);",
301 "}"
302 ],
303 "jn_code": [
304 "// C++: std::vector<int> getTagsHammingDistance()",
305 "private static native int[] getTagsHammingDistance(long address);"
306 ],
307 "cpp_code": [
308 "//",
309 "// manual port",
310 "// std::vector<int> getTagsHammingDistance()",
311 "//\n",
312 "JNIEXPORT jintArray JNICALL Java_org_visp_detection_VpDetectorAprilTag_getTagsHammingDistance (JNIEnv*, jclass, jlong);\n",
313 "JNIEXPORT jintArray JNICALL Java_org_visp_detection_VpDetectorAprilTag_getTagsHammingDistance",
314 " (JNIEnv* env, jclass, jlong self)",
315 "{",
316 " static const char method_name[] = \"detection::getTagsHammingDistance()\";",
317 " try {",
318 " LOGD(\"%s\", method_name);",
319 " vpDetectorAprilTag *tag = (vpDetectorAprilTag*) self;",
320 " std::vector<int> tag_HDs = tag->getTagsHammingDistance();",
321 " jintArray jHDs = env->NewIntArray(tag_HDs.size());",
322 " jint *ptr_HDs = nullptr;",
323 " ptr_HDs = env->GetIntArrayElements(jHDs, 0);",
324 " for (size_t i = 0; i < tag_HDs.size(); i++) {",
325 " ptr_HDs[i] = tag_HDs[i];",
326 " }",
327 " env->ReleaseIntArrayElements(jHDs, ptr_HDs, 0);",
328 " return jHDs;",
329 " } catch(const std::exception &e) {",
330 " throwJavaException(env, &e, method_name);",
331 " } catch (...) {",
332 " throwJavaException(env, 0, method_name);",
333 " }",
334 " return 0;",
335 "}"
336 ]
337 },
338 "getTagsId": {
339 "j_code": [
340 "//",
341 "// manual port",
342 "// C++: std::vector<int> getTagsId()",
343 "//",
344 "//javadoc: VpDetectorAprilTag::getTagsId()\n",
345 "public int[] getTagsId()",
346 "{",
347 " return getTagsId(nativeObj);",
348 "}"
349 ],
350 "jn_code": [
351 "// C++: std::vector<int> getTagsId()",
352 "private static native int[] getTagsId(long address);"
353 ],
354 "cpp_code": [
355 "//",
356 "// manual port",
357 "// std::vector<int> getTagsId()",
358 "//\n",
359 "JNIEXPORT jintArray JNICALL Java_org_visp_detection_VpDetectorAprilTag_getTagsId (JNIEnv*, jclass, jlong);\n",
360 "JNIEXPORT jintArray JNICALL Java_org_visp_detection_VpDetectorAprilTag_getTagsId",
361 " (JNIEnv* env, jclass, jlong self)",
362 "{",
363 " static const char method_name[] = \"detection::getTagsId()\";",
364 " try {",
365 " LOGD(\"%s\", method_name);",
366 " vpDetectorAprilTag *tag = (vpDetectorAprilTag*) self;",
367 " std::vector<int> tag_ids = tag->getTagsId();",
368 " jintArray jIds = env->NewIntArray(tag_ids.size());",
369 " jint *ptr_ids = nullptr;",
370 " ptr_ids = env->GetIntArrayElements(jIds, 0);",
371 " for (size_t i = 0; i < tag_ids.size(); i++) {",
372 " ptr_ids[i] = tag_ids[i];",
373 " }",
374 " env->ReleaseIntArrayElements(jIds, ptr_ids, 0);",
375 " return jIds;",
376 " } catch(const std::exception &e) {",
377 " throwJavaException(env, &e, method_name);",
378 " } catch (...) {",
379 " throwJavaException(env, 0, method_name);",
380 " }",
381 " return 0;",
382 "}"
383 ]
384 },
385 "VpDetectorAprilTag": {
386 "j_code": [
387 "//",
388 "// C++: vpDetectorAprilTag(vpAprilTagFamily tagFamily = TAG_36h11, vpPoseEstimationMethod poseEstimationMethod = HOMOGRAPHY_VIRTUAL_VS)",
389 "//\n",
390 "//javadoc: VpDetectorAprilTag::VpDetectorAprilTag()\n",
391 "public VpDetectorAprilTag()",
392 "{\n",
393 " nativeObj = VpDetectorAprilTag_0();\n",
394 " return;",
395 "}"
396 ],
397 "jn_code": [
398 "// C++: vpDetectorAprilTag(vpAprilTagFamily tagFamily = TAG_36h11, vpPoseEstimationMethod poseEstimationMethod = HOMOGRAPHY_VIRTUAL_VS)",
399 "private static native long VpDetectorAprilTag_0();"
400 ],
401 "cpp_code": [
402 "//",
403 "// vpDetectorAprilTag(vpAprilTagFamily tagFamily = TAG_36h11, vpPoseEstimationMethod poseEstimationMethod = HOMOGRAPHY_VIRTUAL_VS)",
404 "//\n\n",
405 "JNIEXPORT jlong JNICALL Java_org_visp_detection_VpDetectorAprilTag_VpDetectorAprilTag_10 (JNIEnv*, jclass);\n",
406 "JNIEXPORT jlong JNICALL Java_org_visp_detection_VpDetectorAprilTag_VpDetectorAprilTag_10",
407 " (JNIEnv* env, jclass )",
408 "{",
409 " static const char method_name[] = \"detection::VpDetectorAprilTag_10()\";",
410 " try {",
411 " LOGD(\"%s\", method_name);\n",
412 " #if __cplusplus > 199711L ",
413 " vpDetectorAprilTag* _retval_ = new vpDetectorAprilTag(vpDetectorAprilTag::vpAprilTagFamily::TAG_36h11, vpDetectorAprilTag::vpPoseEstimationMethod::HOMOGRAPHY_VIRTUAL_VS );",
414 " #else",
415 " vpDetectorAprilTag *_retval_ = new vpDetectorAprilTag(vpDetectorAprilTag::TAG_36h11,vpDetectorAprilTag::HOMOGRAPHY_VIRTUAL_VS);",
416 " #endif",
417 " return (jlong) _retval_;",
418 " } catch(const std::exception &e) {",
419 " throwJavaException(env, &e, method_name);",
420 " } catch (...) {",
421 " throwJavaException(env, 0, method_name);",
422 " }",
423 " return 0;",
424 "}"
425 ]
426 }
427 }
428 },
429 "type_dict": {
430 "vector_float": {
431 "j_type": "float[]",
432 "jn_type": "float[]",
433 "jni_type": "jfloatArray",
434 "jni_var": "std::vector<float> %(n)s",
435 "suffix": "[F"
436 }
437 }
438}