Handles video input and process video frames. More...
#include <VideoManager.h>
Public Member Functions | |
VideoManager () | |
bool | setInput (std::string filename, bool performSaliencyDetect, int skippedFrames, int startFr, int maxFr) |
sets video file as input More... | |
bool | setInput (int id, bool performSaliencyDetect, int skippedFrames, int startFr, int maxFr) |
sets webcam as input More... | |
bool | setInput (const std::vector< std::string > &imgs, bool performSaliencyDetect, int skippedFrames, int startFr, int maxFr) |
sets set of image files as input More... | |
bool | setOutput (const std::string &filename, int codec=0, double framerate=0.0, bool isColor=true) |
bool | setOutput (const std::string &filename, const std::string &ext, int numberOfDigits=3, int startIndex=0) |
void | setFrameProcessor (void(*frameProcessingCallback)(cv::Mat &, cv::Mat &)) |
void | setFrameProcessor (FrameProcessor *frameProcessorPtr) |
void | stopAtFrameNo (long frame) |
void | callProcess () |
void | dontCallProcess () |
void | displayInput (std::string wn) |
void | displayOutput (std::string wn) |
void | dontDisplay () |
void | setDelay (int d) |
long | getNumberOfProcessedFrames () |
cv::Size | getFrameSize () |
long | getFrameNumber () |
double | getPositionMS () |
double | getFrameRate () |
long | getTotalFrameCount () |
int | getCodec (char codec[4]) |
bool | setFrameNumber (long pos) |
bool | setPositionMS (double pos) |
bool | setRelativePosition (double pos) |
void | stopIt () |
bool | isStopped () |
bool | isOpened () |
void | run (VolumeData &vol) |
starts processing of video | |
Handles video input and process video frames.
Handles video input and process video frames Supported input formats: video files (avi, mp4,...), image sets, webcam Frame Processing: Saliency Detection and Background Subtraction supported
based on an example from the book "Computer Vision Programming using the OpenCV Library":
This file contains material supporting chapter 10 of the cookbook: Computer Vision Programming using the OpenCV Library. by Robert Laganiere, Packt Publishing, 2011.
This program is free software; permission is hereby granted to use, copy, modify, and distribute this source code, or portions thereof, for any purpose, without fee, subject to the restriction that the copyright notice may not be removed or altered from any source or altered source distribution. The software is released on an as-is basis and without any warranties of any kind. In particular, the software is not guaranteed to be fault-tolerant or free from failure. The author disclaims all warranties with regard to this software, any use, and any consequent failure, is purely the responsibility of the user.
|
inline |
Constructor to initialize the VideoManager (and set default values for paramaters)
bool VideoManager::setInput | ( | std::string | filename, |
bool | performSaliencyDetect, | ||
int | skippedFrames, | ||
int | startFr, | ||
int | maxFr | ||
) |
sets video file as input
sets video file as input
filename | is the file location of the video file |
performSaliencyDetect | specifies if Saliency Detection or Background Subtraction is used |
skippedFrames | is the number of skipped frames between two successive processed frames (specifies framrate of videoblock) |
startFr | is the starting frame form the video that is processed |
maxFr | is the maximum number of processed frames |
bool VideoManager::setInput | ( | int | id, |
bool | performSaliencyDetect, | ||
int | skippedFrames, | ||
int | startFr, | ||
int | maxFr | ||
) |
sets webcam as input
sets webcam as input
id | is the webcam id |
performSaliencyDetect | specifies if Saliency Detection or Background Subtraction is used |
skippedFrames | is the number of skipped frames between two successive processed frames (specifies framrate of videoblock) |
startFr | is the starting frame form the video that is processed |
maxFr | is the maximum number of processed frames |
bool VideoManager::setInput | ( | const std::vector< std::string > & | imgs, |
bool | performSaliencyDetect, | ||
int | skippedFrames, | ||
int | startFr, | ||
int | maxFr | ||
) |
sets set of image files as input
sets set of image files as input
imgs | is the set of image file locations |
performSaliencyDetect | specifies if Saliency Detection or Background Subtraction is used |
skippedFrames | is the number of skipped frames between two successive processed frames (specifies framrate of videoblock) |
startFr | is the starting frame form the video that is processed |
maxFr | is the maximum number of processed frames |