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.
Page Index Toggle Pages: 1
OpenCV - PImage (Read 1449 times)
OpenCV - PImage
Mar 3rd, 2009, 12:55pm
 
Hi everyone,

I'm trying to get the OpenCV library up and going with Eclipse - I got it running with the included Java examples, but get stuck when trying to use the Processing + OpenCv example- here's the code and the error. Any info would be great-

Thanks
Jon



import processing.core.*;
import hypermedia.video.OpenCV;



public class OpenCV_PApplet extends PApplet {



OpenCV cv = null;
// OpenCV object



/**

* Initialise Objects.

*/

public void setup() {



// PApplet setup


size( 640, 480 );


background(0);




// OpenCV setup


cv = new OpenCV( this );


cv.capture( width, height );

}



/**

* Display the input video stream in invert mode.

*/

public void draw() {


cv.read();


cv.invert();


image( cv.image(), 0, 0 );

}



/**

* Call the PApplet main method.

*/

public static void main( String[] args ) {


System.out.println( "\nOpenCV meet Processing PApplet\n" );


PApplet.main( new String[]{"OpenCV_PApplet"} );

}

}
 


Exception in thread "Animation Thread" java.lang.NoClassDefFoundError: processing/core/PImage

at hypermedia.video.OpenCV.image(OpenCV.java:764)

at hypermedia.video.OpenCV.image(OpenCV.java:744)

at OpenCV_PApplet.draw(OpenCV_PApplet.java:47)

at processing.core.PApplet.handleDraw(PApplet.java:1406)

at processing.core.PApplet.run(PApplet.java:1311)

at java.lang.Thread.run(Thread.java:613)
Re: OpenCV - PImage
Reply #1 - Mar 3rd, 2009, 12:56pm
 
(sorry about the line spacing, I have no idea...)
Re: OpenCV - PImage
Reply #2 - Mar 3rd, 2009, 2:21pm
 
okay, I'm trying to troubleshoot all this, here's what i've tried.

-displayed a PImage directly from a jpg- no issues. Still crashes when trying to display at

image( cv.image(), 0, 0 );

-I've also tried different core.jar files from different processing version, ya know some funky interconnection problem? 0135, 1.0.1, 1.0.3 - no luck.

unfortunately for me this project is really stuck if i don't get opencv going. -is there another library that will give me the center x,y of a tracked blob?


thanks
Re: OpenCV - PImage
Reply #3 - Mar 4th, 2009, 10:42am
 
follow-up

i dropped Processing's core.jar into my Library/Java/Extensions folder. -- solved the problem.

So it was one thing not finding another thing....
Page Index Toggle Pages: 1