#include <Camera.h>
- stores camera parameters
- continuosly captures frames
- provides frames to other threads
Camera::Camera |
( |
QString |
name, |
|
|
int |
frameWidth, |
|
|
int |
frameHeight, |
|
|
int |
targetFps, |
|
|
int |
bufferSize, |
|
|
QString |
calibrationFile |
|
) |
| |
- Parameters
-
name | descriptive name of the camera for display |
frameWidth | the width of a captured frame |
frameHeight | the height of a captured frame |
targetFps | the frames per second we would like to have |
bufferSize | number of frames that are buffered |
calibrationFile | path to a calibration file in ARToolKitPlus-compatible format |
QString Camera::getCalibrationFile |
( |
) | |
|
|
inline |
returns the filename of the used calibration file
returns actual average frames per second
int Camera::getFrameHeight |
( |
) | |
|
|
inline |
Mat Camera::getFrameMat |
( |
bool |
grayscale = false ) | |
|
returns pixel data of the latest non-blocked frame in the buffer
QImage Camera::getFrameQImage |
( |
bool |
grayscale = false ) | |
|
returns pixel data of the latest non-blocked frame in the buffer as QImage
int Camera::getFrameWidth |
( |
) | |
|
|
inline |
QString Camera::getName |
( |
) | |
|
|
inline |
returns camera's descriptive name
QMatrix4x4 Camera::getProjMat |
( |
) | |
|
|
inline |
get the projection matrix of the camera view
int Camera::getTargetFPS |
( |
) | |
|
|
inline |
returns the desired frames per second
QMatrix4x4 Camera::getViewMat |
( |
) | |
|
|
inline |
get the view matrix of the camera view
virtual void Camera::grabFrame |
( |
) | |
|
|
protectedpure virtual |
process of actually capturing a frame. to be implemented in derived classes.
Implemented in PsEyeCam, and OpenCvCam.
bool Camera::isConnected |
( |
) | |
|
|
inline |
is the camera connected and therefore ready to use?
QImage Camera::matToQImage |
( |
const Mat & |
mat) | |
|
|
protected |
convert an OpenCV Mat to a QImage
void Camera::newFps |
( |
int |
fps) | |
|
|
signal |
signals that the average fps have been updated
void Camera::newFrame |
( |
) | |
|
|
signal |
signals that a new frame is available
main loop; captures frames and stores them to buffer.
virtual void Camera::setExposure |
( |
int |
exposure) | |
|
|
pure virtualslot |
set a new camera exposure
virtual void Camera::setGain |
( |
int |
gain) | |
|
|
pure virtualslot |
void Camera::setViewMatrix |
( |
QMatrix4x4 |
viewMat) | |
|
|
inlineslot |
void Camera::stopAndDelete |
( |
) | |
|
void Camera::submitFrame |
( |
Mat |
m, |
|
|
bool |
mono |
|
) |
| |
|
protected |
stores m in a slot of the framebuffer, that is not used by any thread
void Camera::updateFPS |
( |
int |
timeElapsed) | |
|
|
protected |
QString Camera::calibrationFile |
|
protected |
is the camera ready to use?
index of the freshest frame in the buffer
QMutex Camera::curFrameMutex |
|
protected |
provides thread safety for the curFrameIdx
volatile bool Camera::doStop |
|
protected |
set to true if the thread should stop soon
QQueue<int> Camera::fpsQueue |
|
protected |
const int Camera::fpsQueueLength = 32 |
|
staticprotected |
QList<Frame> Camera::frameBuffer |
|
protected |
stores a couple of camera frames. not related to GPU-framebuffers..
int Camera::maxConcurrentReads |
|
protected |
the number of threads that are allowed to read from the buffer at the same time
descriptive name of the camera
QMatrix4x4 Camera::projMat |
|
protected |
the projection matrix of the camera view (derived from intrinsic camera parameters)
provides thread safety for killing the thread
desired frames per second
QMatrix4x4 Camera::viewMat |
|
protected |
the view matrix of the camera view (derived from extrinsic camera parameters)
The documentation for this class was generated from the following files: