OpenCV can't capture the frame from the webcam.
Hello All, I am using OpenCV 2.4.6 with VS2010. I think my webcam can't capture the frame. When I executed the code it has builed successfully. But I am not getting output. I think, when I checked "if(!bSuccess)" its executed and can't capture frame from the webcam. Please help me, how can I resolve it. Thanks in advanced.........
Mat frame;
bool bSuccess = cap.read(frame);
if (!bSuccess)
{
cout << "Cannot read a frame from video file" << endl;
break;
}
good idea to check cap.isOpened() before attempting to read()
also, it is a bit strange that your code snippet doesn't contain a creating of a VideoCapture element to actually capture frames from.
Your trying to save every frame or you just want to run your webcam ?