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
webcam tiltscan framerate (Read 292 times)
webcam tiltscan framerate
Feb 4th, 2008, 6:46pm
 
Hi!
I'm working on a tiltscan via a webcam, just like the example within Processing.
Tha cam I'm using is Logitch 9000 it works perfect on Leopard and processing. But to compleet a "scan" like 800x800 it taks up 1 minute. The cam can take (upto) 30Fps, so I need it at a faster rate. cranking up the framRate() doesn't give me any luck. But perhaps I mis something.

My code:
loadPixels();
for (int e = 0; e < eNImage.height; e++){
  int setPixelIndex = e*width + drawPositionX;
  int getPixelIndex = e*eNImage.width  + videoSliceX;
  pixels[setPixelIndex] = eNImage.pixels[getPixelIndex];
}
updatePixels();

It takes 1 line of pixels from the center of the cam. And updates the line inside an image, moves up 1 pixels and does another scan. Correct me if I'm wrong but: 30Fps x 800 Pixels should give me around 25 sec to compleet.

Is there a way to speed this up?
Just had an idea to make some kind of Loop where I grab all the lines. When it's done I "draw" the screen. Am I on the right track?


Best regards
Jan

Page Index Toggle Pages: 1