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.
IndexProgramming Questions & HelpVideo Capture,  Movie Playback,  Vision Libraries › Video library problem with version 0148
Page Index Toggle Pages: 1
Video library problem with version 0148 (Read 363 times)
Video library problem with version 0148
Aug 31st, 2008, 9:32am
 
Hello everybody!

I'm at the first attempt with processing...I have been using since a few month Arduino and its developpement enviroment.

On Tom Igoe's book i found this interesting code to make Processing able to recongnize colors from a Web-Cam...The problem is that the new version ( i think ) don't load the VIDEO library well...here is the initial part of the code, where compiling get stuck:

import processing.video.*
//instance of the capture class
Capture myCamera;

void setup()
{
//window size
size(320, 240);
//list all available cameras
println(Capture.list());
//capture second device available
String myCam= Capture.list()[1];
myCamera = new Capture(this, myCam, width, height, 30);
}

void draw(){
image(myCamera, 0,0);
}

void captureEvent(Capture myCamera) {
myCamera.read();
}

When i compile i get ----> expecting EOF, found 'void
On the forum i found topic about the same problem and it seemed like it is a bug problem...on the bug page i am getting no replies, so maybe you can help!

Do you know an older version available that doesn't give such problems?
Re: Video library problem with version 0148
Reply #1 - Sep 6th, 2008, 3:25am
 
You forgot to put a semicolon after you import the video library Wink

Also you are passing too many arguments into Capture. Try this:

Quote:


import processing.video.*;  // I added a semicolon here
//instance of the capture class
Capture myCamera;

void setup()
{
//window size
size(320, 240);
//list all available cameras
println(Capture.list());
//capture second device available
String myCam= Capture.list()[1];
myCamera = new Capture(this, width, height, 30); // I removed "myCam" from here
}

void draw(){
image(myCamera, 0,0);
}

void captureEvent(Capture myCamera) {
myCamera.read();
}  



Hope this helps:)
Re: Video library problem with version 0148
Reply #2 - Sep 9th, 2008, 10:15am
 
Thank you!

I also found another tutorial on the internet, and i joined the two codes toghether and...I works!

By the way if you want to see it you will find it in another topic i've began:

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Video;action=display;num=1220888696

Hope you will help me as you did with this Topic

THanks again!!


Page Index Toggle Pages: 1