VisualizeVideo
 All Classes Functions Pages
Public Member Functions | List of all members
VideoManager Class Reference

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
 

Detailed Description

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.

Copyright (C) 2010-2011 Robert Laganiere, www.laganiere.name

Constructor & Destructor Documentation

VideoManager::VideoManager ( )
inline

Constructor to initialize the VideoManager (and set default values for paramaters)

Member Function Documentation

bool VideoManager::setInput ( std::string  filename,
bool  performSaliencyDetect,
int  skippedFrames,
int  startFr,
int  maxFr 
)

sets video file as input

sets video file as input

Parameters
filenameis the file location of the video file
performSaliencyDetectspecifies if Saliency Detection or Background Subtraction is used
skippedFramesis the number of skipped frames between two successive processed frames (specifies framrate of videoblock)
startFris the starting frame form the video that is processed
maxFris 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

Parameters
idis the webcam id
performSaliencyDetectspecifies if Saliency Detection or Background Subtraction is used
skippedFramesis the number of skipped frames between two successive processed frames (specifies framrate of videoblock)
startFris the starting frame form the video that is processed
maxFris 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

Parameters
imgsis the set of image file locations
performSaliencyDetectspecifies if Saliency Detection or Background Subtraction is used
skippedFramesis the number of skipped frames between two successive processed frames (specifies framrate of videoblock)
startFris the starting frame form the video that is processed
maxFris the maximum number of processed frames

The documentation for this class was generated from the following files: