How to handle the wrappers generated by SWIG?

asked 2015-03-30 11:45:46 -0600

Gopi Krishnan gravatar image

My intension is to generate wrappers or bindings on top of C++ , for languages like java desktop,java andriod,python,c# and ios.

I found the tool called SWIG and tried. However, its hard to work with it for non-primitive data types.

I know that OpenCV community is automating the wrappers generation using either tools like SWIG or through some scripts exclusively written.

So far, from my analysis, i got to know that there are some scripts for C++ -> Python Bindings.

Can anyone help me to know the how opencv community handles wrapper generation?

Any help with tutorials, Source Codes would be great.

edit retag flag offensive close merge delete

Comments

2

they're not using swig. (that was tried, but discarded long ago).

look here, please.

also note, that there are java / android wrappers already , generated in the very same manner.

berak gravatar imageberak ( 2015-03-30 11:53:19 -0600 )edit

Thanks for your answer. Can you also send me the tutorials or any related documents to know how OpenCV automates the wrapper generation for java(desktop and android), C# ? If possible, can you please let us know the reason for dropping the SWIG?

Gopi Krishnan gravatar imageGopi Krishnan ( 2015-03-31 00:53:47 -0600 )edit
1

you could just try to run modules/java/generator/gen_java.py from the cmdline, to see, what it's doing ;)

(also, no idea about SWIG, but the downside with that is probably, that you still have to manually maintain, what's wrapped)

berak gravatar imageberak ( 2015-03-31 02:02:56 -0600 )edit
1

SWIG likes to tell us something else ;)

boaz001 gravatar imageboaz001 ( 2015-03-31 02:25:43 -0600 )edit

Thank you berak.. Let me just walk through it.. Is there any documented source to start up quickly or to understand it in a better way?...

Gopi Krishnan gravatar imageGopi Krishnan ( 2015-03-31 05:08:45 -0600 )edit

@berak , i found the gen2.py and tried to generate the python wrappers,but having issues. Please see the link

Gopi Krishnan gravatar imageGopi Krishnan ( 2015-04-01 10:48:01 -0600 )edit