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
Capturing camera images of a sketch (Read 275 times)
Capturing camera images of a sketch
Mar 2nd, 2009, 12:02am
 
For calibration purposes, I want to display structured drawings/images in my Processing sketch, and capture a camera's view of that with the Capture package.

By calibration I mean a camera pixel to sketch pixel mapping, so that if a camera frame shows something of interest, I can locate it in my sketch, within a reasonable accuracy.

I believe there is no "immediate" mode drawing in Processing, right?  I.e. no way to force the pixels[] to be displayed in the sketch other than at the end of the draw() proc?

I ask because I'd prefer to draw some pixels, wait for cam.available() (maybe twice), then grab the camera's view of the structured image, in a loop involving at least 20 draw/capture pairs.  

The alternative appears to set up a fairly simple state machine, and in even draws create the drawing, and odd draws capture the camera's image of that drawing.

I suspect this has been done several times, but I didn't find it via searching.  Any pointers?
Re: Capturing camera images of a sketch
Reply #1 - Mar 2nd, 2009, 3:18am
 
Hey, would this do the trick?
 http://processing.org/hacks/hacks:registerevents

I think this means I could register an post() method that would be called after draw() renders.

Has anyone used post() for a similar purpose -- post rendering operations??
Page Index Toggle Pages: 1