I’m trying to set up a facial recognition system for my art degree - where I want it to print off peoples faces each time they enter the gallery space. The code I’ve used, from a couple of guides, is included below - and is apparently a basic facial recognition script. Unfortunately, I get the following error - can anyone help?
“2021-10-26 11:34:32.472 java[2098:69034] Warning: Expected min height of view: (<NSButton: 0x7fb107884470>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
2021-10-26 11:34:32.475 java[2098:69034] Warning: Expected min height of view: (<NSButton: 0x7fb107855dd0>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
Processing video library using GStreamer 1.16.2
OpenCV for Processing 0.5.4 by Greg Borenstein http://gregborenstein.com
Using Java OpenCV 2.4.5.0
Load cascade from: /Users/richardmead/Documents/Processing/libraries/opencv_processing/library/cascade-files/haarcascade_frontalface_alt.xml
Cascade loaded: haarcascade_frontalface_alt.xml
BaseSrc: [avfvideosrc0] : Device video access permission has just been denied
Could not run the sketch (Target VM failed to initialize).
For more information, read revisions.txt and Help → Troubleshooting.”
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);
video.start();
}
void draw() {
scale(2);
opencv.loadImage(video);
image(video, 0, 0 );
noFill();
stroke(0, 255, 0);
strokeWeight(3);
Rectangle[] faces = opencv.detect();
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();
}