AlexP
thank you for your help.
I try to do some color/movement tracking for an art application.
Best for me would be to use OpenCV in Processing, because it has lots of useful functions
for my application.
Below is a little example to show the problem. I just want to read
a videostream into OpenCV
import hypermedia.video.*;
OpenCV opencv;
void setup() {
size( 320, 240 );
opencv = new OpenCV( this );
opencv.capture( width, height ); // open video stream
}
public void stop() {
opencv.stop();
super.stop();
}
void draw() {
opencv.read(); //get the next frame
image(opencv.image(),0,0); // show it
}
If I run this I always get the error message:
“Error while starting capture: device 0”
If I do the same with the Standard video Processing lib it works:
import processing.video.*;
Capture cam;
void setup() {
size(640, 480);
cam = new Capture(this, 320, 240);
}
void draw() {
if (cam.available() == true) {
cam.read();
image(cam, 160, 100);
}
}
Just tryed to I use a work around with OpenCV:
Use processing.video to read the camera and copy the image to the opencv buffer.
And go from there with openCV.
This works, but I have no idea how much performance this costs.
greetings knutl