Ask Your Question
0

cvGrabFrame block my Computer

asked 2013-01-04 04:09:54 -0600

hello,

I have a problem with CvQueryFrame function, when I call this it blocks my computer, the fan start to make noise and the only way to stop this is rebooting the computer.

I'm using opencv2.3.4 and I test cvGrabFrame function also and it block the computer again.

this is a peace of code

CvCapture *capture;
IplImage * imGrab;

capture=cvCaptureFromCAM(0);
while ((imGrab==NULL)&&(numERROR<5))
{
//imGrab= cvQueryFrame(captuer);
int tmp=cvGrabFrame(capture);
imgrab=cvRetrieveFrame(capture,tmp);
if(!imGrab)
{
cerr<<"ERROR:grame is null... iter " <<numError<<endl;
numError;
}

any sugestion

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-01-05 04:13:57 -0600

CvQueryFrame is blocking function. It blocks thread until frame from camera will be ready. If there is some problem with camera, it leads to deadlock. There is some C samples that uses old OpenCV 1.x API and video camera, i.e. samples/c/fback_c.c. You can use it as base for your code.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-01-04 04:09:54 -0600

Seen: 581 times

Last updated: Jan 05 '13