From 3b084fa4f3a0914643ae94938166877ceff6c82b Mon Sep 17 00:00:00 2001 From: Tadas Baltrusaitis Date: Sun, 5 Nov 2017 08:56:25 +0000 Subject: [PATCH] Some small fixes on recording in feature extraction. --- exe/FeatureExtraction/FeatureExtraction.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/exe/FeatureExtraction/FeatureExtraction.cpp b/exe/FeatureExtraction/FeatureExtraction.cpp index 6f808a3..1f9f807 100644 --- a/exe/FeatureExtraction/FeatureExtraction.cpp +++ b/exe/FeatureExtraction/FeatureExtraction.cpp @@ -157,11 +157,6 @@ void visualise_tracking(cv::Mat& captured_image, const LandmarkDetector::CLNF& f fpsSt += fpsC; cv::putText(captured_image, fpsSt, cv::Point(10, 20), CV_FONT_HERSHEY_SIMPLEX, 0.5, CV_RGB(255, 0, 0), 1, CV_AA); - if (!det_parameters.quiet_mode) - { - cv::namedWindow("tracking_result", 1); - cv::imshow("tracking_result", captured_image); - } } int main (int argc, char **argv) @@ -415,7 +410,7 @@ int main (int argc, char **argv) // Work out the pose of the head from the tracked model cv::Vec6d pose_estimate = LandmarkDetector::GetPose(face_model, fx, fy, cx, cy); - // Visualising the tracker, TODO this should be in utility + // Drawing the visualization on the captured image if (recording_params.outputTrackedVideo() || (visualize_track && !det_parameters.quiet_mode)) { visualise_tracking(captured_image, face_model, det_parameters, gazeDirection0, gazeDirection1, frame_count, fx, fy, cx, cy); @@ -431,6 +426,13 @@ int main (int argc, char **argv) open_face_rec.SetObservationTimestamp(time_stamp); open_face_rec.WriteObservation(); + // Visualize the image if desired + if (visualize_track && !det_parameters.quiet_mode) + { + cv::namedWindow("tracking_result", 1); + cv::imshow("tracking_result", captured_image); + } + // Grabbing the next frame (todo this should be part of capture) if(video_input) {