Camera Not Being Released

asked 2016-04-04 14:59:01 -0500

codersquirrel gravatar image

Hi all I have

while (!janela->FINALIZADA ) {
camera >> frame;
  cv::imshow(janelasNome[0], frame);
 key = cv::waitKey(5) & 255;
            if (key == 99 || FIM) {
                 cv::destroyAllWindows();
                camera.release();
                break;
            }
}

but the camera is not being released. I tried to call camera.release() after the end of the while but the camera isn't being released either. I know that because it keeps with the lights on and when i try to open again the programs crashs and gives me

HIGHGUI ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV VIDIOC_STREAMON: Bad file descriptor OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /home/schirrel/Github/opencv/opencv-2.4.10/modules/highgui/src/window.cpp, line 261 terminate called after throwing an instance of 'cv::Exception' what(): /home/schirrel/Github/opencv/opencv-2.4.10/modules/highgui/src/window.cpp:261: error: (-215) size.width>0 && size.height>0 in function imshow

how can i force the camera release?

btw i tried to put an amount of camera.release() one after another and nothing changes.

edit retag flag offensive close merge delete

Comments

I don't think it would help you

LBerger gravatar imageLBerger ( 2016-04-05 02:45:13 -0500 )edit

yeah it didn't

codersquirrel gravatar imagecodersquirrel ( 2016-04-05 06:35:15 -0500 )edit