camera webcam
05 / 09 / 2018
Camera Webcam
​
I got an Idea from webcam on Mac. Which there is a filter with love on our head, actually i want to make it like that but i dont know how to make it. So, its just turn like this.
​
https://drive.google.com/file/d/19uXz1pkPWQ5do-PB2cB8ZV6p7hdDAUrP/view?usp=sharing
​
​
import processing.sound.*;
import gab.opencv.*;
import java.awt.*;
import processing.video.*;
int mode = 0;
Capture video;
SoundFile loveffect;
PImage love;
OpenCV opencv;
void setup() {
love = loadImage("love.png");
size(900, 900);
video = new Capture(this,320,240);
opencv = new OpenCV(this, 320, 240);
opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
video.start();
loveffect = new SoundFile(this, "loveffect.mp3");
loveffect.play();
}
void draw() {
if(video.available()){// same thing
video.read();
}
scale(2);
opencv.loadImage(video);
image(video, 0, 0 );
noFill();
stroke(0, 255, 0);
strokeWeight(3);
Rectangle[] faces = opencv.detect();
println(faces.length);
for (int i = 0; i < faces.length; i++) {
image(love,faces[i].x,faces[i].y);
}
}