direcs  2012-09-30
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CamThread Class Reference

This class gets a live picture from a Kinect camera. This class uses the QThread techniques and then some OpenCV stuff on the live picture; we will see... More...

#include <camThread.h>

List of all members.

Public Slots

void enableFaceDetection (int state)
void setThreshold (int threshold)

Signals

void camImageComplete (QImage *image)
void camImageDepthComplete (QImage *image)
void camImageOpenCVComplete (QImage *image)
void disableCamera ()
void disableFaceDetection ()
void faceDetected (int faces, int faceX, int faceY, int faceRadius, int lastFaceX, int lastFaceY)
void message (QString text)

Public Member Functions

 CamThread ()
bool init ()
bool isConnected (void)
virtual void run ()
void setCascadePath (QString haarClassifierCascade)
void stop ()
 ~CamThread ()

Private Attributes

bool cameraIsOn
char * data
char * dataDepth
freenect_context * f_ctx
freenect_device * f_dev
bool faceDetectionIsEnabled
bool faceDetectionWasActive
Mat gray
QString haarClassifierCascadeFilename
bool initDone
std::vector< uint16_t > m_gamma
int mThreshold
QImage qimage
QImage qimageDepth
QImage qimageOpenCV
volatile bool stopped
unsigned int timestamp

Static Private Attributes

static const unsigned long THREADSLEEPTIME = 50

Detailed Description

This class gets a live picture from a Kinect camera. This class uses the QThread techniques and then some OpenCV stuff on the live picture; we will see...

Definition at line 56 of file camThread.h.


Constructor & Destructor Documentation

CamThread::CamThread ( )

Definition at line 24 of file camThread.cpp.

CamThread::~CamThread ( )

Definition at line 38 of file camThread.cpp.


Member Function Documentation

void CamThread::camImageComplete ( QImage *  image)
signal
Parameters:
*imageis a pointer to the camera image
See also:
Gui::setCamImage()

Here is the caller graph for this function:

void CamThread::camImageDepthComplete ( QImage *  image)
signal
Parameters:
*imageis a pointer to the camera image
See also:
Gui::setCamImageDepth()

Here is the caller graph for this function:

void CamThread::camImageOpenCVComplete ( QImage *  image)
signal
Parameters:
*imageis a pointer to the camera image
See also:
Gui::setCamImageOpenCV()

Here is the caller graph for this function:

void CamThread::disableCamera ( )
signal

Disables camera controls in the GUI

void CamThread::disableFaceDetection ( )
signal

Disables checkBoxes in the GUI

Here is the caller graph for this function:

void CamThread::enableFaceDetection ( int  state)
slot

Enables or disables the face detection. When activated, a circle for each face is drawn on the camera live image.

Parameters:
statehas to be Qt::Checked to enable the detection. All other states disable.

Definition at line 175 of file camThread.cpp.

void CamThread::faceDetected ( int  faces,
int  faceX,
int  faceY,
int  faceRadius,
int  lastFaceX,
int  lastFaceY 
)
signal

This signal is emmited when a face was detected in the camera image

Parameters:
facesis the total number of faces detected
faceXis the X coordinate to the middle of a detected face (0, if none)
faceYis the Y coordinate to the middle of a detected face (0, if none)
faceRadiusis the radius (0, if none)
lastFaceXis the X coordinate of the latest face detected
lastFaceYis the Y coordinate of the latest face detected
See also:
Direcs::faceTracking()
bool CamThread::init ( )
Returns:
true on success

Definition at line 203 of file camThread.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool CamThread::isConnected ( void  )

Definition at line 169 of file camThread.cpp.

void CamThread::message ( QString  text)
signal

Emits a info or error message to a slot. This slot can be used to display a text on a splash screen, log file, to print it to a console...

Parameters:
textis the message to be emitted

Here is the caller graph for this function:

void CamThread::run ( )
virtual

Definition at line 53 of file camThread.cpp.

Here is the call graph for this function:

void CamThread::setCascadePath ( QString  haarClassifierCascade)

Sets the path and filename to the haar classifier cascade.

Parameters:
haarClassifierCascadeis the whole filename

Definition at line 189 of file camThread.cpp.

Here is the call graph for this function:

void CamThread::setThreshold ( int  threshold)
slot

Set threshold for OpenCV algorithm.

Parameters:
threshold

Definition at line 246 of file camThread.cpp.

Here is the caller graph for this function:

void CamThread::stop ( )

Definition at line 47 of file camThread.cpp.

Here is the caller graph for this function:


Member Data Documentation

bool CamThread::cameraIsOn
private

Definition at line 171 of file camThread.h.

char* CamThread::data
private

Definition at line 153 of file camThread.h.

char* CamThread::dataDepth
private

Definition at line 154 of file camThread.h.

freenect_context* CamThread::f_ctx
private

Definition at line 150 of file camThread.h.

freenect_device* CamThread::f_dev
private

Definition at line 151 of file camThread.h.

bool CamThread::faceDetectionIsEnabled
private

Definition at line 172 of file camThread.h.

bool CamThread::faceDetectionWasActive
private

Definition at line 173 of file camThread.h.

Mat CamThread::gray
private

Definition at line 160 of file camThread.h.

QString CamThread::haarClassifierCascadeFilename
private

Definition at line 174 of file camThread.h.

bool CamThread::initDone
private

Definition at line 170 of file camThread.h.

std::vector<uint16_t> CamThread::m_gamma
private

Definition at line 164 of file camThread.h.

int CamThread::mThreshold
private

Definition at line 162 of file camThread.h.

QImage CamThread::qimage
private

Definition at line 157 of file camThread.h.

QImage CamThread::qimageDepth
private

Definition at line 158 of file camThread.h.

QImage CamThread::qimageOpenCV
private

Definition at line 159 of file camThread.h.

volatile bool CamThread::stopped
private

Definition at line 175 of file camThread.h.

const unsigned long CamThread::THREADSLEEPTIME = 50
staticprivate

Definition at line 179 of file camThread.h.

unsigned int CamThread::timestamp
private

Definition at line 155 of file camThread.h.


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