Ask Your Question

cvGrabFrame block my Computer

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


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;

while ((imGrab==NULL)&&(numERROR<5))
//imGrab= cvQueryFrame(captuer);
int tmp=cvGrabFrame(capture);
cerr<<"ERROR:grame is null... iter " <<numError<<endl;

any sugestion

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

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


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

Seen: 579 times

Last updated: Jan 05 '13