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
AVT cameras - Marlin, frame grabbing (Read 688 times)
AVT cameras - Marlin, frame grabbing
May 3rd, 2009, 1:29pm
 
I'm using a Marlin Allied webcam on a Mac OSX 10.5.
There was a problem of resize:
I wanted to use a image of 320x240 > the image grabbed was minimum 640x480.
Due to the cropping system of Capture.class, i got only the middle of the frame.

After several hours of research in Capture, i came to this point:
If i declare a Capture of 640x480, i get the full frame.
I just changed the crop function in read(): instead of cropping, resizing the image >>

PImage temp = new PImage(dataWidth, dataHeight);
raw.copyToArray(0, temp.pixels, 0, dataWidth * dataHeight);

PImage resized = new PImage(requestWidth, requestHeight);
resized.blend(temp, 0, 0, dataWidth, dataHeight, 0, 0,
requestWidth, requestHeight, PImage.BLEND);
pixels = resized.pixels;


Any better idea to fix this?
Page Index Toggle Pages: 1