revisione ortografica e grammaticale
[capturemjpeg.git] / docs / relazione / sources / capture_blur.pde
blobc89d19814a47472bb8edaba284d0c5ae3e72d463
1 import processing.video.*;
3 // Variable for capture device
4 Capture img;
7 void setup() {
8   size(320, 240, P3D);
9   frameRate(5);
11   colorMode(RGB, 255, 255, 255, 100);
13   img = new Capture(this, width, height, 12);
14   
15   background(0);
19 void draw() { 
20   if (img.available()) {
21     img.read();
22   
23     img.filter(GRAY);
24     image(img, 0, 0);
26     PImage edgeImg=new PImage(img.width/2, img.height);
27     edgeImg.copy(img, 0, 0, img.width/2, img.height,
28                   0, 0, edgeImg.width, edgeImg.height);
29     edgeImg.filter(BLUR);
30     // Draw the new image
31     image(edgeImg, img.width/2, 0);
32   }