Using opencv, how can one split a video into an image sequence?
How can i split it so that the output will be a sequence of images?
相关问题
- Sorting 3 numbers without branching [closed]
- Multiple sockets for clients to connect to
- How to get the background from multiple images by
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
For my surprise, I couldn't find an answer to this question on StackoverFlow.
I'm currently using OpenCV 2.1. This might be a little old but it works like a charm. The program will read an input file and create a sequence of images on the current folder named *frame_xx.jpg*
Even after my edits, the question looks more like a "send-me-the-codez" demand than a typical StackOverflow question whereby the OP provides detailed information and demonstrates that he or she has put some real thought into it.
So I'll just give a "half answer"... Anyway I'm only moderately familiar with OpenCV's machine learning module and barely cognizant of the rest of the library. ;-)
In a nutshell, the pseudo code should look like that and the implementation would typically require the OpenCV methods mentioned.
As hinted the above needs much syntax and logic work (eg. figuring out when to stop, producing the file name of the individual frames, and of course declaring properly the variables and using the right level of indirection w/ all them pointers ;-). Of course some of this is made easier if you use the Python interface.
The Reading and Writing Images and Video OpenCV documentation page, provides more detailed info about the individual methods.