【发布时间】:2018-04-10 20:03:27
【问题描述】:
我正在使用 Processing、OpenCV 和 Arduino 进行人脸跟踪项目。我遇到了一些问题。
代码如下:
import hypermedia.video.*;
import java.awt.Rectangle;
OpenCV opencv;
// contrast/brightness values
int contrast_value = 0;
int brightness_value = 0;
void setup() {
size( 320, 240 );
opencv = new OpenCV( this );
opencv.capture( width, height ); // open video stream
opencv.cascade( OpenCV.CASCADE_FRONTALFACE_ALT2 ); // load detection description, here-> front face detection : "haarcascade_frontalface_alt.xml"
// print usage
println( "Drag mouse on X-axis inside this sketch window to change contrast" );
println( "Drag mouse on Y-axis inside this sketch window to change brightness" );
}
void draw() {
// grab a new frame
// and convert to gray
opencv.read();
opencv.convert( GRAY );
opencv.contrast( contrast_value );
opencv.brightness( brightness_value );
// proceed detection
Rectangle[] faces = opencv.detect( 1.2, 2, OpenCV.HAAR_DO_CANNY_PRUNING, 40, 40 );
// display the image
image( opencv.image(), 0, 0 );
// draw face area(s)
noFill();
stroke(255,0,0);
for( int i=0; i<faces.length; i++ ) {
rect( faces[i].x, faces[i].y, faces[i].width, faces[i].height );
}
}
错误就在这里:
[opencv fatal error] library not loaded !
THIS VERSION OF OPENCV LIBRARY REQUIRE ADDITIONAL DEPENDENCIES.
READ THE INSTALLATION INSTRUCTIONS AT http://ubaa.net/shared/processing/opencv/
Verify that the '\path\to\OpenCV\bin' exists in your system PATH and the java.library.path property is correctly.
error message: C:\Users\User\Documents\Processing\libraries\OpenCV\library\OpenCV.dll: Can't find dependent libraries
A library relies on native code that's not available.
Or only works properly when the sketch is run as a 64-bit application.
我做了正确的安装,添加到路径,我编译它处理 32 位应用程序和处理 64 位应用程序相同的错误。
【问题讨论】:
标签: opencv processing