July 2015
Intermediate to advanced
174 pages
3h 45m
English
Another important I/O task in computer vision is being able to open and process a video file. Fortunately, OpenCV can easily deal with videos through the VideoCapture class. Instead of constructing it with a device number, as was done previously, we need to create it with the file path. We can also use the empty constructor and make the open(String filename) method responsible for pointing to the file.
The videoplayback project available in the chapter's source code has the same structure as the swing-imageshow project, explained previously. It only differs when you initialize the VideoCapture instance:
VideoCapture capture = new VideoCapture("src/main/resources/videos/tree.avi");We have also put a 50ms delay between each frame so ...
Read now
Unlock full access