VAT  3.0
Video Analysis Tool
Public Member Functions | List of all members
CameraThread Class Reference

The CameraThread class is used as a Thread class to parallelly capture video frames from camera. This class is in charge of manage the thread that grab images from camera. More...

#include <CameraThread.h>

Inheritance diagram for CameraThread:

Public Member Functions

 CameraThread (QObject *parent=0)
 When objects of this class are created, The time stamp counter is started and a buffer that will store captured frames is also created with a size of BUFFER_SIZE. More...
 
void stop ()
 stop This method is used to stop capturing images from camera. Camera is disconnected.
 
void setup (int device_ID)
 setup This method is for local camera. It prepares camera for connection and establish connection according to the device_ID. More...
 
void setup (QString URL)
 
cv::Mat & get_frame (int &time_stamp)
 get_frame This method is used by external process that wants access to the next oldest available frame and removes the frame from buffer. More...
 
double buffer_usage ()
 Buffer occupation ratio method. More...
 

Detailed Description

The CameraThread class is used as a Thread class to parallelly capture video frames from camera. This class is in charge of manage the thread that grab images from camera.

Constructor & Destructor Documentation

CameraThread::CameraThread ( QObject *  parent = 0)
explicit

When objects of this class are created, The time stamp counter is started and a buffer that will store captured frames is also created with a size of BUFFER_SIZE.

Parameters
parentQObject parent according to QObject tree organization.

CameraThread:

Member Function Documentation

double CameraThread::buffer_usage ( )

Buffer occupation ratio method.

Returns
Floating point value between 0 and 1, This identify the buffer occupation ratio.
cv::Mat & CameraThread::get_frame ( int &  time_stamp)

get_frame This method is used by external process that wants access to the next oldest available frame and removes the frame from buffer.

Parameters
time_stampInteger variable where time capture identifyer of frame to be obtained will be stored.
Returns
Next oldest frame available in buffer.
void CameraThread::setup ( int  device_ID)

setup This method is for local camera. It prepares camera for connection and establish connection according to the device_ID.

Parameters
device_IDLocal camera identifier. For linux this number corresponds to X from the device /dev/videoX.
void CameraThread::setup ( QString  URL)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters
URLRemote camera identifier with credentials. This route has the following format: rtsp://[USER]:[PASSWORD]@[IP ADDRESS]:[PORT][/path/to/metadata.amp]

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