VideoCapture result in distorted lines in image

asked 2016-11-14 01:52:01 -0500

Saghir Khatri gravatar image

updated 2016-11-14 01:52:35 -0500

I am trying to click an image from Webcam using OpenCV. My code is as follows.

VideoCapture cap0(0);
cap0.set(CV_CAP_PROP_FRAME_WIDTH,320);
cap0.set(CV_CAP_PROP_FRAME_HEIGHT,240);
cap0 >> frame;
string fileName = "/0.jpg";
cout << fileName << endl;
imwrite(fileName, frame);

I am getting this image as output

image description

You can see some weird lines in output., What is the possible reason and how i can eliminate these Please point me to the right direction.

Thanks

edit retag flag offensive close merge delete