I am trying to capture the frame from analog camera using VS13, OpenCV and AverMedia DVD EZMaker 7.
If i make a simple cycle like
while (true){
frame = cvQueryFrame(capture);
cvShowImage("My window", frame);
if (cvWaitKey(33) == 27) { // нажата ESC
break;
}
}
i get a frame, but the frame has a noise like this:
This lines appears if it has a dynamic object on the frame.
However i was trying to capture a camera using Media Player Classic. And i had two types of output images. First image had the same noise.
But when i changed (in MPC) a format from "RGB24" to "YUVU" i have a better result
My question: How can i fix this trouble? I want to capture a correct frame without lines.
P.s. Also i tryed to use VideoInput library in my program, but it didn't help. The frame was with noise. I used this code to capture:
VI.setIdealFramerate(dev1, 25); //the framerate change didn't solve the problem
VI.setupDevice(dev1, 720, 576, 0);
image_VI = cvCreateImage(cvSize(VI.getWidth(dev1), VI.getHeight(dev1)), IPL_DEPTH_8U, 3);
while (true){
VI.getPixels(dev1, (unsigned char *)image_VI->imageDataOrigin, false, true);
cvShowImage("My window", image_VI);
if (cvWaitKey(33) == 27) {
// ESC
break;
}
}
P.P.s: When i used a cvCvtColor operator (OpenCV or VideoInput):
cvCvtColor(frame, frame2, CV_RGB2YUV); cvShowImage("My window", frame2);
i had an incorrect color reproduction. //and noise
When i created an image using IPL_DEPTH_16U (VideoInput) i had an incorrect color reproduction, i had 2 images in window, but that images shown without noise.
P.p.p.s. Sorry for my bad english. I think, i have a lot of mistaker in my grammar. But i hope that i accessibly explain the problem.