Ask Your Question

How to de-interlace a frame

asked 2018-05-04 15:38:37 -0500

I was just wondering what would be the right way to deinterlace images coming from a video (interlace one of course). My code sort of looks like this:

VideoCapture cap("video.mp4",  cv::CAP_FFMPEG); // open the default camera
if(!cap.isOpened())  // check if we succeeded
    return -1;

    Mat frame;
    cap >> frame; // get a new frame from camera
    imshow("frame", frame);
    if(waitKey(30) >= 0) break;
// the camera will be deinitialized automatically in VideoCapture destructor
return 0;

but now I'm not entirely sure how to run the algorithm to de-interlace any given frame. Any ideas?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2018-05-04 20:15:17 -0500

berak gravatar image

either it's the wrong word,or you're entirely in the wrong place.

(opencv is a computer-vision api, not a video-processing one. to handle de-interlacing, you'dhave to go one level deeper, to ffmpeg / gstreamer, whatever processes the raw video data)

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-05-04 15:38:37 -0500

Seen: 1,320 times

Last updated: May 04 '18