Camera Error
in
Contributed Library Questions
•
1 year ago
Hi all -
Trying to work with the camera and I occasionally get this error.. SGIdle failed in icvGrabFrame_QT_Cam with error -1
What can I disable with QT so that the camera may be reliably accessed with processing? Thank you
code:
Trying to work with the camera and I occasionally get this error.. SGIdle failed in icvGrabFrame_QT_Cam with error -1
What can I disable with QT so that the camera may be reliably accessed with processing? Thank you
code:
- import hypermedia.video.*;
import java.awt.Rectangle;
boolean foundIt;
int timer;
OpenCV opencv;
// contrast/brightness values
//int contrast_value = 0;
//int brightness_value = 0;
void setup() {
size( 640, 480 );
opencv = new OpenCV( this );
opencv.capture( width, height ); // open video stream
opencv.cascade( OpenCV.CASCADE_FRONTALFACE_ALT ); // load detection description, here-> front face detection : "haarcascade_frontalface_alt.xml"
}
public void stop() {
opencv.stop();
super.stop();
}
void draw()
{
opencv.read();
// proceed detection
Rectangle[] faces = opencv.detect( 1.2, 2, OpenCV.HAAR_DO_CANNY_PRUNING, 40, 40 );
foundIt=true;
// display the image
image( opencv.image(), 0, 0 );
// draw face area(s)
noFill();
noStroke();
for( int i=0; i<faces.length; i++ )
{
rect( faces[i].x, faces[i].y, faces[i].width, faces[i].height );
if (foundIt==true){
timer=millis();
println(timer);
} else if( foundIt==false)
{
if (millis()-timer>=50000)
{
//Do something
println("buzz");
}
}
}
}
1