我正在尝试在Catalina的MAC上使用Processing 4和OpenCV。然而,我遇到了以下错误:
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
当我运行这段代码时
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();
}
我知道Processing在Catalina上存在相机问题,但这似乎不是问题所在。我能够在其他草图中成功使用相机。
我会感激任何反馈。谢谢。