开发者

Extracting slides from video lectures using OpenCV

I would like to extract out all the slides from a video lecture, using OpenCV. Here is an example of a lecture: ht开发者_运维百科tp://www.youtube.com/watch?v=-hxOpz9c0bY.

What approaches would you recommend? So far, I've tried:

  • Comparing the change in grayscale intensity from frame to frame. This can have problems when an object in the foreground moves around. For example, in this lecture, there's a hand that moves around: http://www.youtube.com/watch?v=mNzu42FrlHo#t=07m00s.

  • Using SURF features and doing comparisons frame by frame. This approach seems kind of slow.

Does anyone have other ideas?


Most of this work is most likely already done by video encoder. You just need to extract key-frames and check how well compressed are frames between them.

It should be also fairly easy to distinguish still images. You can save lot of time by examining just the key-frames. Slides are likely to have high contrast, solid shapes, solid background. Lecture hall has blurry shapes and low contrast.


What you need is a scene change detection. After that, you'll have to classify scenes as "lecture hall" or "presentation". As for the problem with hands - you could use background subtraction with an adaptive background (just make sure you mask the foreground... you don't want the foreground to become a part of the background).


You could try an edge detection and look for a rectangular object - the slides (above a certain area threshold). You could further reduce FPs by looking for some text within the rectangle.


There are several reasons to extract slides/frames from a video presentation, especially in the case of education or conference related videos. It allows you to access the study notes without watching the whole video.

I have faced this issue several times, so I decided to create a solution for it myself using python. I have made the code open-source, you can easily set up this tool and run it in few simple steps.

Refer to this for a youtube video tutorial. Steps on how to use this tool.

  • Clone this project video2pdfslides
  • Set up your environment by running "pip install -r requirements.txt"
  • Copy your video path
  • Run "python video2pdfslides.py <video_path>" Boom! the pdf slides will be available in the output folder Make notes and enjoy!
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜