summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2011-09-28 11:53:53 +0300
committerYuval Adam <yuv.adm@gmail.com>2011-09-28 11:53:53 +0300
commitb4cff00b082acc16c7b43e1f4d6ded285281ca09 (patch)
tree2fcb646eb1fe76ec047a043681cf7525fd63cd61
parent3e4edaf94322ebff0a339d0898dca2126a85b0b8 (diff)
webcam face detection updatesHEADmaster
-rw-r--r--webcam_face/webcam_face.pde14
1 files changed, 5 insertions, 9 deletions
diff --git a/webcam_face/webcam_face.pde b/webcam_face/webcam_face.pde
index 49564be..943c946 100644
--- a/webcam_face/webcam_face.pde
+++ b/webcam_face/webcam_face.pde
@@ -5,6 +5,9 @@ OpenCV opencv;
void setup() {
size(640, 480);
+ fill(0,0);
+ stroke(255,0,0);
+
opencv = new OpenCV(this);
opencv.capture(320, 240);
opencv.cascade(OpenCV.CASCADE_FRONTALFACE_ALT);
@@ -12,22 +15,15 @@ void setup() {
void draw() {
opencv.read();
- // display the current video feed
image(opencv.image(), 0, 0);
// detect anything ressembling a FRONTALFACE
Rectangle[] faces = opencv.detect();
-
- // draw detected face area(s)
- fill(255,0,0);
- stroke(255,0,0);
+
for (int i=0; i<faces.length; i++) {
- // copy a specific area from the image in memory (the background)
- // place the copy exactly where the face is in the current image
rect(faces[i].x,faces[i].y,faces[i].width,faces[i].height);
}
-
- // display the image in memory
+
image(opencv.image(OpenCV.MEMORY), 329, 0);
}