diff options
author | Stéphane Lenclud <github@lenclud.com> | 2019-02-01 17:11:43 +0100 |
---|---|---|
committer | Stéphane Lenclud <github@lenclud.com> | 2019-02-07 13:24:13 +0100 |
commit | e419e8056cd883d0c5465b20343d69eba8c255ae (patch) | |
tree | cad93218afc478edc472817b373b3a5c291be1d6 | |
parent | af286a3fa5e1460faad85b816149ad1309ef3584 (diff) |
Kinect: Initializing positions and rotations to zero.
-rw-r--r-- | tracker-kinect-face/tracker.cpp | 11 | ||||
-rw-r--r-- | tracker-kinect-face/tracker.h | 15 |
2 files changed, 8 insertions, 18 deletions
diff --git a/tracker-kinect-face/tracker.cpp b/tracker-kinect-face/tracker.cpp index 9b03f492..1ab14c87 100644 --- a/tracker-kinect-face/tracker.cpp +++ b/tracker-kinect-face/tracker.cpp @@ -84,8 +84,13 @@ KinectFaceTracker::KinectFaceTracker(): m_pCoordinateMapper(nullptr), m_pColorFrameReader(nullptr), m_pColorRGBX(nullptr), - m_pBodyFrameReader(nullptr) - + m_pBodyFrameReader(nullptr), + iLastFacePosition{0,0,0}, + iFacePositionCenter{ 0,0,0 }, + iFacePosition{ 0,0,0 }, + iLastFaceRotation{ 0,0,0 }, + iFaceRotationCenter{ 0,0,0 }, + iFaceRotation{ 0,0,0 } { m_pFaceFrameSource = nullptr; m_pFaceFrameReader = nullptr; @@ -175,7 +180,7 @@ void KinectFaceTracker::data(double *data) data[1] = (iLastFacePosition.Y - iFacePositionCenter.Y) * 100; data[2] = (iLastFacePosition.Z - iFacePositionCenter.Z) * 100; - // Yaw, picth, Roll + // Yaw, Picth, Roll data[3] = 0-(iLastFaceRotation.X - iFaceRotationCenter.X); // Invert to be compatible with ED out-of-the-box data[4] = (iLastFaceRotation.Y - iFaceRotationCenter.Y); data[5] = (iLastFaceRotation.Z - iFaceRotationCenter.Z); diff --git a/tracker-kinect-face/tracker.h b/tracker-kinect-face/tracker.h index cfadf997..162e1cff 100644 --- a/tracker-kinect-face/tracker.h +++ b/tracker-kinect-face/tracker.h @@ -38,21 +38,6 @@ private: Timer t; // Kinect stuff - - // define the face frame features required to be computed by this application - static const DWORD c_FaceFrameFeatures = - FaceFrameFeatures::FaceFrameFeatures_BoundingBoxInColorSpace - | FaceFrameFeatures::FaceFrameFeatures_PointsInColorSpace - | FaceFrameFeatures::FaceFrameFeatures_RotationOrientation - | FaceFrameFeatures::FaceFrameFeatures_Happy - | FaceFrameFeatures::FaceFrameFeatures_RightEyeClosed - | FaceFrameFeatures::FaceFrameFeatures_LeftEyeClosed - | FaceFrameFeatures::FaceFrameFeatures_MouthOpen - | FaceFrameFeatures::FaceFrameFeatures_MouthMoved - | FaceFrameFeatures::FaceFrameFeatures_LookingAway - | FaceFrameFeatures::FaceFrameFeatures_Glasses - | FaceFrameFeatures::FaceFrameFeatures_FaceEngagement; - static const int cColorWidth = 1920; static const int cColorHeight = 1080; |