help! Null Pointer Exception error
in
Contributed Library Questions
•
1 years ago
Hey everyone. I'm getting this error after running my code:
import java.awt.*;
import hypermedia.video.*;
OpenCV opencv;
void setup() {
size( 320, 240 );
opencv = new OpenCV( this );
opencv.capture( width, height );
opencv.cascade( "haarcascades/haarcascade_frontalface_alt.xml" );
}
void draw() {
opencv.read();
Rectangle[] faces =
opencv.detect( 1.2, 2, OpenCV.HAAR_DO_CANNY_PRUNING, 40, 40 );
image( opencv.image(), 0, 0 );
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 );
}
}
public void stop() {
opencv.stop();
super.stop();
}
I've checked the webcam and it just works and I have added the bin folder to PATH.
Could anyone please help me out? Thx!
I'm running Processing 1.5.1 on windows 7 using virtual PC XP mode
1