I intend to use opencv with processing for face detection
while the examples are explicit in how to do face detection on a static image when i am trying to apply that using video from a webcam the method is not working
is thr a tutorial fr that
this hw i tried without much luck-
Please try to format your code properly when posting, otherwise it’s hard to read. (Preformatted Text “</>”-icon on the top).
I think the opencv-lib is image based and doesn’t handle videos by default. But you can pass the frames of your webcam to opencv with the OPENCV.loadImage() method. Here is an adapted example:
import processing.video.*;
import gab.opencv.*;
import java.awt.Rectangle;
Capture video;
OpenCV opencv;
Rectangle[] faces;
void setup() {
size(320, 180);
video = new Capture(this, width, height);
video.start();
opencv = new OpenCV(this, video.width, video.height);
opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
}
void draw() {
opencv.loadImage(video);
faces = opencv.detect();
image(opencv.getInput(), 0, 0);
noFill();
stroke(0, 255, 0);
strokeWeight(3);
for (int i = 0; i < faces.length; i++) {
rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height);
}
}
void captureEvent(Capture c) {
c.read();
}
Hi
for computer vision and face detection using the webcam what library should i use in processing.
My programming skills are pretty limited so would like to know of a library that is well documented with tutorial.
/You can may to use LiveCamTest, one of OpenCV libraries, i did use this with a webcam in real-time video, this detect one or two faces at the same time, I hope it helps you! /
import gab.opencv.;
import processing.video.;
import java.awt.;
Capture video;
OpenCV opencv;
void setup() {
size(640, 480);
video = new Capture(this, 640/2, 480/2);
opencv = new OpenCV(this, 640/2, 480/2);
opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);