Ask Your Question
0

How is the open cv java code created [closed]

asked 2018-05-22 07:14:31 -0500

holger gravatar image

Hello,

I am a bit curious how the JNI java / c++ code is created. Are you using any code generation libraries like swig or are they handwritten?

Thx a lot + Greetings, Holger

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by holger
close date 2018-05-22 11:22:01.560334

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-05-22 08:14:12 -0500

berak gravatar image

they are generated from python scripts (which read the c++ headers). have a look at https://github.com/opencv/opencv/tree... , and https://docs.opencv.org/master/da/d49... (same idea for python and matlab).

if you run cmake / make locally, to build the opencv libs, those generated jni / java files will be in opencv/build/modules/java_bindings_generator/gen

edit flag offensive delete link more

Comments

Thx berak - i need to do a similar thing what open CV does (JNI) and was looking for some inspiration on how other guys are doing it.

Thx for the link - i will see if i can adopt it for my environment (windows7) Closing as solved.

holger gravatar imageholger ( 2018-05-22 11:21:26 -0500 )edit

the android samples have some jni code, too !

berak gravatar imageberak ( 2018-05-22 11:39:57 -0500 )edit
1

I did it! - managed to get two dlls working together in a java fx app, via sharing open cv mat objects - great! The big trick(taken from adroid samples) was casting the pointer passed as jlong to the c++ pointer type!

Great! Thx again.

holger gravatar imageholger ( 2018-05-28 04:11:46 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-05-22 07:14:31 -0500

Seen: 42 times

Last updated: May 22 '18