VideoCapture result in distorted lines in image [closed]
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
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