We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Pages: 1 2 3 
OpenCV library in Processing? (Read 25884 times)
OpenCV library in Processing?
Oct 9th, 2006, 4:49pm

Has anyone attempted or researched into creating a processing library for OpenCV?

Re: OpenCV library in Processing?
Reply #1 - Oct 11th, 2006, 12:54pm
tex and i have been discussing strategies to get OpenCV to processing / java. right now there are several approaches.

+ JNI: manually write a JNI binding to the OpenCV interface.
+ SWIG: use SWIG to create a native binding. with the perspective of using the python SWIG files that create the 'official' python binding.
+ OSC: write a 'binding' to OSC either in C++ or in java ( need JNI again ) much like eyesweb.

right now we are in the process of investigating the feasibility of these approaches.

we would really like to start a project on this. since we don t have that much spare time at hand, the progress is very slow though. but opencv is really promising and definitly worth the effort.

Re: OpenCV library in Processing?
Reply #2 - Oct 26th, 2006, 12:57pm
I'm also interesting in calling OpenCV from Processing. I would be willing to contribute code to a project to build a Java wrapper using either a custom JNI wrapper or a SWIG binding. OpenCV is big so SWIG sounds like a good idea.

I'm currently working on a JNI interface to the bitmap tracing library Potrace (http://potrace.sourceforge.net). Potrace only really has one function so it's pretty straightforward.
Re: OpenCV library in Processing?
Reply #3 - Nov 6th, 2006, 12:57pm
i just registered a project at sourceforge.

  OpenCV for Processing

this is the proposal i wrote to sourceforge. it roughly outlines the roadmap.
'OpenCV for Processing' is a processing library ( http://www.processing.org/ ) for OpenCV that aims to make OpenCV technologies accessible to the processing community. as of now there exists no such project.

in the architecture of this library we deliberatly reflect the 'mindset' of the processing environment. we achieve this by creating three different types of bindings.
the first is a low-level java binding that uses SWIG to create a 'raw' and high-performance access to the OpenCV API.
the second is a high-level binding that either builds on the low-level binding or wraps native modules ( e.g. face recognition ). the focus here is to create an easy-to-use experience.
the third is a network based binding that uses Open Sound Control to communicate via network with OpenCV modules. this approach is inspired by the EyesWeb project ( http://www.infomus.dist.unige.it/eywindex.html ).

i probably won't work on it until the end of the month. but i would be absolutely happy to see people joinging the project.

the first task for me would be to investigate the existing SWIG interface, currently used for the python binding and see what can be used for the low level java binding.

in terms of tools, we will probably use a combination of eclipse plugins: java, cdt, skwash. although their value still needs to be validated and is part of the developement process.
Re: OpenCV library in Processing?
Reply #4 - Nov 6th, 2006, 10:06pm
Sweet. Good stuff.

I'm about half way through the Potrace binding. When I finish up I'd love to see any initial stuff you've produced.

The OSC stuff is an interesting twist. I'm looking at using Processing to produce live generative animations to go with DJ sets performed with Ableton Live. I'll probably use MIDI to pass control info from Live to my sketches however.
Re: OpenCV library in Processing?
Reply #5 - Dec 11th, 2006, 10:31am
Good afternoon.

Are you done with the JNI binding of potrace?

Since this is excatly what I was looking for my question is, do you plan to share or publish it?  

If so I am really interested in it.

Re: OpenCV library in Processing?
Reply #6 - Dec 11th, 2006, 11:18am
Progress on the potrace binding has been halted as I've been away for a few weeks and then my girlfriend dislocated her knee. It's basically written, but it's not working correctly yet and so I need to go through and test and fix it.

When it is complete I will definitely be sharing it. In the meantime, you might want to look at BlobDetection library: http://www.v3ga.net/processing/BlobDetection/ , which is complete, available and works pretty well. I'm continuing work on the potrace binding to see if the results are better, they may be worse Smiley.
Re: OpenCV library in Processing?
Reply #7 - Dec 16th, 2006, 12:52am
This is all very exciting, as I was just looking into OpenCV as a possibility, but outside of Processing.

JNI isn’t out of the question for us, but we’ll have to look at the project more to see what we can contribute. More later...
Re: OpenCV library in Processing?
Reply #8 - Feb 7th, 2007, 11:59am
i quickly modified an opencv face detection example to broacast the results via OSC to Processing.

here is the result. it only works on OS X now. but it should be portable to any other platform.

./FaceDetectionOSC –cascade=haarcascade_frontalface_default.xml

the packets /x, /y and /radius are broadcasted to localhost/ via OSC.


Re: OpenCV library in Processing?
Reply #9 - Jan 18th, 2008, 11:57am
does anyone made a version for PC or even Linux ?
Re: OpenCV library in Processing?
Reply #10 - Jan 18th, 2008, 12:02pm
Yes, it looks like its coming. Douglas and Stéphane having been making v good progress by the looks of it. Not public yet though.

Re: OpenCV library in Processing?
Reply #11 - Jan 19th, 2008, 4:03pm
Yeah, we're almost there. Mac OS (Universal Binary) works. Just finishing documentation and cleaning up things. We'll release some time in the next few weeks. We need PC compatibility and need Linux compatibility and there's no reason these shouldn't work. But no guarantees until we're done.

Unfortunately, don't expect the full 100% of OpenCV. So far, we only have edge detection and basic image manipulation with some filtering. We'll add more as we evolve. Also, we'd like some feedback from the Processing community on what people want to see from the OpenCV base, and also if anyone understands what the §@#& those mathematical formulas in the documentation mean. I'm just not a math nerd, sorry.

On the positive side, you can use OpenCV to capture directly from your camera, and you can also feed it your own image. So you don't need to use the Processing capture class in that case. Or you could feed it webcam images from the web, or your own sketch window, whatever. You can also get those images back after they've been worked on. I.e. OpenCV can be used as a basic image processor. So that's cool.

On the downside, OpenCV capture only works on a few webcams (iSight, for example) and only at 640x480. We can quick-shrink it for you immediately after capture so that your analysis goes faster, but it's still pulling it off the camera at 640x480. This is probably not much of a problem, but still. We find the edge detection at 640x480 to be perfectly workable and fast enough for most needs (with the added advantage of high resolution), but you have the option nevertheless.

Oh, and no parameter settings for your camera yet, which totally sucks. But both of those are OpenCV-port-to-Mac problems, so now we're going to have to work on the original source to fix those problems. Again, we still have a long way to go.
Re: OpenCV library in Processing?
Reply #12 - Jan 19th, 2008, 7:57pm
oki nice, good you post on this thread as soon as you have a working pc version ?

Re: OpenCV library in Processing?
Reply #13 - Feb 8th, 2008, 12:36pm
tibou wrote on Jan 19th, 2008, 7:57pm:
oki nice, good you post on this thread as soon as you have a working pc version

We'll be working on PC this weekend, and trying to get it working over the next two weeks during a residency. Should have something at the end of all that.
Re: OpenCV library in Processing?
Reply #14 - Feb 23rd, 2008, 6:04am
Hi Friends,
As i am Seeing a Good discussion threas Thread on OpenCV for Java.
As I am also looking for similar library before start working on it.I did'nt get any detail for downloading development so far.Is it available anywhere.

Thanks in Advance
Abhishek Verma

Pages: 1 2 3