LiveFit
Track and plot projectiles for in-class demonstration
Public Slots | Signals | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
FrameConverter Class Reference

Recieves frames (as cv::Mat), processes them (ideally asynchronously) and emits them as a QImage (i.e. More...

#include <FrameConverter.hpp>

Inheritance diagram for FrameConverter:
Inheritance graph
[legend]
Collaboration diagram for FrameConverter:
Collaboration graph
[legend]

Public Slots

void processFrame (const cv::Mat &frame, enum ColorSpace)
 Add a new frame to be processed; if not processAll this frame may yet be dropped. More...
 
void setFrameSize (QSize size)
 Set the resolution of the frames we are processing.
 
void stop ()
 Stop processing frames.
 

Signals

void imageReady (const QImage &)
 Emitted when we have a QImage from processing ready for display.
 

Public Member Functions

 FrameConverter (QObject *parent=0)
 
void setProcessAll (bool all)
 Set whether we should process all frames, or drop some.
 

Private Member Functions

void queue (const cv::Mat &frame, ColorSpace cs)
 Queue a new frame to be processed (depends on processAll if it gets processed). More...
 
void process (cv::Mat frame, ColorSpace cs)
 Actually process a frame. More...
 
void timerEvent (QTimerEvent *ev)
 Called each time that mTimer ticks... More...
 

Static Private Member Functions

static void matDeleter (void *mat)
 Delete a cv::Mat object.
 

Private Attributes

QBasicTimer mTimer
 Process a frame at each tick of this timer.
 
cv::Mat currentFrame
 The current frame to process into a QImage.
 
ColorSpace currentCS
 The current ColorSpace of the frame we are processing.
 
bool processAll = true
 Whether we should process all frames, or drop some to keep framerate.
 
QSize frameSize
 The resolution of the frames that we are processing.
 

Detailed Description

Recieves frames (as cv::Mat), processes them (ideally asynchronously) and emits them as a QImage (i.e.

for use in a QWidget)

Member Function Documentation

void FrameConverter::process ( cv::Mat  frame,
ColorSpace  cs 
)
private

Actually process a frame.

Resultant QImage gets emitted by imageReady()

void FrameConverter::processFrame ( const cv::Mat &  frame,
enum  ColorSpace 
)
slot

Add a new frame to be processed; if not processAll this frame may yet be dropped.

void FrameConverter::queue ( const cv::Mat &  frame,
ColorSpace  cs 
)
private

Queue a new frame to be processed (depends on processAll if it gets processed).

void FrameConverter::timerEvent ( QTimerEvent *  ev)
private

Called each time that mTimer ticks...

we call process on the queue in here.


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