Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How do you stop a capture frame getting split ?

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 image description

but sometimes it doesn't

image description

How does one stop this frame splitting ?

How do you stop a capture frame getting split ?

I have a simple program.

include "cv.h"

include "highgui.h"

include "unistd.h"

include "iostream"

using namespace std;

#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "iostream"

using namespace cv;

cv; using namespace std; int main(int argc, char** argv)
argv) { Mat frame; VideoCapture capture; {
Mat frame;
VideoCapture capture;

capture.open(0);
capture.open(0); if(!capture.isOpened()){ // check if we succeeded
succeeded cout << "Cannot open capture." << endl;
endl; return -1;
}
capture.read(frame);
-1; } capture.read(frame); imwrite("img.jpg", frame);
capture.release();
frame); capture.release(); return 0;
}

0; }

It usually works with a good photo image description

but sometimes it doesn't

image description

How does one stop this frame splitting ?

How do you stop a capture frame getting split ?

I have a simple program.

#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "iostream"

using namespace cv;
using namespace std;

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 image description

but sometimes it doesn't

image description

How does one stop this frame splitting ?