Compare commits

..

2 Commits

Author SHA1 Message Date
Julian LECLERC cbb47880db cameraFeed2 2022-04-06 13:51:46 +02:00
Julian LECLERC efa66c4a71 CameraFeed 2022-04-06 12:15:41 +02:00
1 changed files with 38 additions and 0 deletions

38
Camerafeed/Camerafeed.pde Normal file
View File

@ -0,0 +1,38 @@
import processing.video.*;
Capture cam;
int x =0;
int d = 25;
int eyeZone = 10;
float s = 1/5;
int start = 0;
void setup() {
size(750, 480);
cam = new Capture(this, width, height);
cam.start();
loop();
x=0;
}
void draw() {
if(cam.available()) {
cam.read();
}
image(cam, 0, 0);
if(x<20 && start==1){
saveFrame("frame_#####.jpg");
x++;
}
delay( int(s*1000) );
//fill(255,0,0);
rect(width*0.5-d*2-eyeZone/2,height*0.5,eyeZone,5);
rect(width*0.5+d*2-eyeZone/2,height*0.5,eyeZone,5);
fill(0,0);
rect(width*0.5-3*d/2,height*0.5-d*5/2,3*d,3*d/2);
}
void keyPressed() {
start = 1;
println("ok");
}