I have a simple program.
include "cv.h"
include "highgui.h"
include "unistd.h"
include "iostream"
using namespace std;
using namespace cv;
int main(int argc, char** argv)
{
Mat frame;
VideoCapture capture;
capture.open(0);
if(!capture.isOpened()){ // check if we succeeded
cout << "Cannot open capture." << endl;
return -1;
}
capture.read(frame);
imwrite("img.jpg", frame);
capture.release();
return 0;
}
It usually works with a good photo
but sometimes it doesn't
How does one stop this frame splitting ?