예제 #1
0
  public void draw() {
    image(webcam, 0, 0);
    stroke(0xffFF0000);
    strokeWeight(3);

    cv.loadImage(webcam);
    Rectangle[] faces = cv.detect();
    for (int i = 0; i < faces.length; i++) {
      rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height);
    }
  }
예제 #2
0
  public void setup() {
    webcam = new Capture(this, width, height);
    cv = new OpenCV(this, width, height);

    webcam.start();

    cv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
  }