SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
CVTracked is the pure virtual base class for tracking features in video. More...
#include <CVTracked.h>
Public Member Functions | |
CVTracked () | |
virtual | ~CVTracked ()=default |
virtual bool | track (CVMat imageGray, CVMat imageBgr, CVCalibration *calib)=0 |
void | drawDetection (bool draw) |
bool | isVisible () |
bool | drawDetection () |
CVMatx44f | objectViewMat () |
Static Public Member Functions | |
static cv::Matx44f | createGLMatrix (const CVMat &tVec, const CVMat &rVec) |
Create an OpenGL 4x4 matrix from an OpenCV translation & rotation vector. More... | |
static void | createRvecTvec (const CVMatx44f &glMat, CVMat &tVec, CVMat &rVec) |
Creates the OpenCV rvec & tvec vectors from an column major OpenGL 4x4 matrix. More... | |
static CVMatx44f | calcObjectMatrix (const CVMatx44f &cameraObjectMat, const CVMatx44f &objectViewMat) |
static CVVec3f | averageVector (vector< CVVec3f > vectors, vector< float > weights) |
static SLQuat4f | averageQuaternion (vector< SLQuat4f > quaternions, vector< float > weights) |
static void | resetTimes () |
Resets all static variables. More... | |
Static Public Attributes | |
static AvgFloat | trackingTimesMS |
Averaged time for video tracking in ms. More... | |
static AvgFloat | detectTimesMS |
Averaged time for video feature detection & description in ms. More... | |
static AvgFloat | detect1TimesMS |
Averaged time for video feature detection subpart 1 in ms. More... | |
static AvgFloat | detect2TimesMS |
Averaged time for video feature detection subpart 2 in ms. More... | |
static AvgFloat | matchTimesMS |
Averaged time for video feature matching in ms. More... | |
static AvgFloat | optFlowTimesMS |
Averaged time for video feature optical flow tracking in ms. More... | |
static AvgFloat | poseTimesMS |
Averaged time for video feature pose estimation in ms. More... | |
Protected Attributes | |
bool | _isVisible |
Flag if marker is visible. More... | |
bool | _drawDetection |
Flag if detection should be drawn into image. More... | |
CVMatx44f | _objectViewMat |
view transformation matrix More... | |
HighResTimer | _timer |
High resolution timer. More... | |
CVTracked is the pure virtual base class for tracking features in video.
The static vector trackers can hold multiple of CVTracked that are tracked in scenes that require a live video image from the device camera. A tracker is bound to a scene node. If the node is the camera node the tracker calculates the relative position of the camera to the tracker. This is the standard augmented reality case. If the camera is a normal scene node, the tracker calculates the object matrix relative to the scene camera. See also the derived classes CVTrackedAruco, CVTrackedChessboard, CVTrackedFaces and CVTrackedFeature for example implementations. The update of the tracking per frame is implemented in onUpdateTracking in AppDemoTracking.cpp and called once per frame within the main render loop.
Definition at line 49 of file CVTracked.h.
|
inlineexplicit |
Definition at line 52 of file CVTracked.h.
|
virtualdefault |
|
static |
Definition at line 153 of file CVTracked.cpp.
Definition at line 134 of file CVTracked.cpp.
|
static |
Calculates the object matrix from the cameraObject and the object view matrix.
Nomenclature: T = homogenous transformation matrix
aTb = homogenous transformation matrix with subscript b and superscript a
Subscrips and superscripts: w = world; o = object; c = camera
cTo = Transformation of object with respect to camera coordinate system. It describes the position of an object in the camera coordinate system. We get this transformation from OpenCVs solvePNP function.
wTc = (cTw)-1 = Transformation of camera with respect to world coord.-system. Inversion exchanges sub- and superscript.
The inverse of the camera to world matrix is the view matrix or camera matrix.
We can combine two or more homogenous transformations to a new one if the inner sub- and superscript fit together. The resulting transformation inherits the superscript from the left and the subscript from the right transformation. The following transformation is what we want to do:
wTo = wTc * cTo = Transformation of object with respect to world coordinate system (object matrix)
Definition at line 125 of file CVTracked.cpp.
Create an OpenGL 4x4 matrix from an OpenCV translation & rotation vector.
Definition at line 46 of file CVTracked.cpp.
Creates the OpenCV rvec & tvec vectors from an column major OpenGL 4x4 matrix.
Definition at line 74 of file CVTracked.cpp.
|
inline |
Definition at line 64 of file CVTracked.h.
|
inline |
Definition at line 60 of file CVTracked.h.
|
inline |
Definition at line 63 of file CVTracked.h.
|
inline |
Definition at line 65 of file CVTracked.h.
|
static |
Resets all static variables.
Definition at line 31 of file CVTracked.cpp.
|
pure virtual |
Implemented in CVTrackedWAI, CVTrackedFaces, CVTrackedChessboard, CVTrackedArucoCube, CVTrackedAruco, and CVTrackedFeatures.
|
protected |
Flag if detection should be drawn into image.
Definition at line 92 of file CVTracked.h.
|
protected |
Flag if marker is visible.
Definition at line 91 of file CVTracked.h.
|
protected |
view transformation matrix
Definition at line 93 of file CVTracked.h.
|
protected |
High resolution timer.
Definition at line 94 of file CVTracked.h.
|
static |
Averaged time for video feature detection subpart 1 in ms.
Definition at line 84 of file CVTracked.h.
|
static |
Averaged time for video feature detection subpart 2 in ms.
Definition at line 85 of file CVTracked.h.
|
static |
Averaged time for video feature detection & description in ms.
Definition at line 83 of file CVTracked.h.
|
static |
Averaged time for video feature matching in ms.
Definition at line 86 of file CVTracked.h.
|
static |
Averaged time for video feature optical flow tracking in ms.
Definition at line 87 of file CVTracked.h.
|
static |
Averaged time for video feature pose estimation in ms.
Definition at line 88 of file CVTracked.h.
|
static |
Averaged time for video tracking in ms.
Definition at line 82 of file CVTracked.h.