diff options
| -rw-r--r-- | webcam_face/code/OpenCV.dll | bin | 0 -> 515184 bytes | |||
| -rw-r--r-- | webcam_face/code/OpenCV.jar | bin | 0 -> 12116 bytes | |||
| -rw-r--r-- | webcam_face/code/libOpenCV.jnilib | bin | 0 -> 80088 bytes | |||
| -rw-r--r-- | webcam_face/code/libOpenCV.so | bin | 0 -> 42861 bytes | |||
| -rw-r--r-- | webcam_face/webcam_face.pde | 37 |
5 files changed, 37 insertions, 0 deletions
diff --git a/webcam_face/code/OpenCV.dll b/webcam_face/code/OpenCV.dll Binary files differnew file mode 100644 index 0000000..43d6997 --- /dev/null +++ b/webcam_face/code/OpenCV.dll diff --git a/webcam_face/code/OpenCV.jar b/webcam_face/code/OpenCV.jar Binary files differnew file mode 100644 index 0000000..a953e3c --- /dev/null +++ b/webcam_face/code/OpenCV.jar diff --git a/webcam_face/code/libOpenCV.jnilib b/webcam_face/code/libOpenCV.jnilib Binary files differnew file mode 100644 index 0000000..7c44ea2 --- /dev/null +++ b/webcam_face/code/libOpenCV.jnilib diff --git a/webcam_face/code/libOpenCV.so b/webcam_face/code/libOpenCV.so Binary files differnew file mode 100644 index 0000000..8328d5b --- /dev/null +++ b/webcam_face/code/libOpenCV.so diff --git a/webcam_face/webcam_face.pde b/webcam_face/webcam_face.pde new file mode 100644 index 0000000..49564be --- /dev/null +++ b/webcam_face/webcam_face.pde @@ -0,0 +1,37 @@ +import hypermedia.video.*; +import java.awt.Rectangle; + +OpenCV opencv; + +void setup() { + size(640, 480); + opencv = new OpenCV(this); + opencv.capture(320, 240); + opencv.cascade(OpenCV.CASCADE_FRONTALFACE_ALT); +} + +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); +} + +void keyPressed() { + opencv.remember(); +} + |
