Ask Your Question

bungler's profile - activity

2016-01-16 09:42:28 -0600 received badge  Enthusiast
2016-01-04 10:25:46 -0600 received badge  Self-Learner (source)
2016-01-04 10:04:52 -0600 answered a question How do you stop a capture frame getting split ?

It would appear that sturkmen is sort of right.

I modified the code to grab 3 frames (a, b, c) and write those 3 frames to disk. About 90% of the time frame a (the first) is OK. Frames b & c always appear to be OK - even when frame a is bad.

I now read two frames and throw the first away. Seems to have solved my problem.

Thanks all

2016-01-02 12:10:27 -0600 commented question How do you stop a capture frame getting split ?

O/S is Linux 4.1.7 on a Raspberry Pi B+
OpenCV 2.4.10
USB video class driver is 1.1.1
Camera identified in system logs as...
Jan 1 00:00:04 rfm69cw kern.info kernel: [ 4.698340] usb 1-1.5: New USB device found, idVendor=1908, idProduct=2311
Jan 1 00:00:04 rfm69cw kern.info kernel: [ 4.733121] uvcvideo: Found UVC 1.00 device USB2.0 PC CAMERA (1908:2311)
Jan 1 00:00:04 rfm69cw kern.info kernel: [ 4.737792] input: USB2.0 PC CAMERA as /devices/platform/bcm2708_usb/usb1/1-1/1-1.5/1-1.5:1.0/input/input0

2016-01-02 10:19:04 -0600 asked a question 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 ?