I'm trying to use OpenCV with Processing 4 on a MAC with Catalina. However, I am getting the following error:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by gab.opencv.OpenCV (file:/Users/mmemmo/Documents/Processing/libraries/opencv_processing/library/opencv_processing.jar) to field java.lang.ClassLoader.sys_paths
when I run this code
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);
//CASCADE_EYE
opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
// opencv.loadCascade(OpenCV.CASCADE_EYE);
video.start();
}
void draw() {
scale(2);
opencv.loadImage(video);
image(video, 0, 0 );
noFill();
stroke(0, 255, 0);
strokeWeight(3);
Rectangle[] faces = opencv.detect();
println(faces.length);
for (int i = 0; i < faces.length; i++) {
println(faces[i].x + "," + faces[i].y);
rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height);
}
if(faces.length > 0 ){
println("Hello Human");enter code here
}
}
void captureEvent(Capture c) {
c.read();
}
I know Processing has camera issues with Catalina. That doesn't seem to be the issue here. I was able to get the camera working just fine in other sketches.
I would appreciate any feedback. Thanks.