From b1524ca98b18a04d15578b9de62ff7d31e58cbce Mon Sep 17 00:00:00 2001 From: Tadas Baltrusaitis Date: Mon, 26 Mar 2018 08:26:48 +0100 Subject: [PATCH] Making sure AU visualization works with other executables. --- exe/FaceLandmarkImg/FaceLandmarkImg.cpp | 1 + exe/FaceLandmarkVidMulti/FaceLandmarkVidMulti.cpp | 1 + lib/local/Utilities/src/Visualizer.cpp | 11 ++++++----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/exe/FaceLandmarkImg/FaceLandmarkImg.cpp b/exe/FaceLandmarkImg/FaceLandmarkImg.cpp index 594ac7d..3599b1a 100644 --- a/exe/FaceLandmarkImg/FaceLandmarkImg.cpp +++ b/exe/FaceLandmarkImg/FaceLandmarkImg.cpp @@ -203,6 +203,7 @@ int main (int argc, char **argv) visualizer.SetObservationLandmarks(face_model.detected_landmarks, 1.0, face_model.GetVisibilities()); // Set confidence to high to make sure we always visualize visualizer.SetObservationPose(pose_estimate, 1.0); visualizer.SetObservationGaze(gaze_direction0, gaze_direction1, LandmarkDetector::CalculateAllEyeLandmarks(face_model), LandmarkDetector::Calculate3DEyeLandmarks(face_model, image_reader.fx, image_reader.fy, image_reader.cx, image_reader.cy), face_model.detection_certainty); + visualizer.SetObservationActionUnits(face_analyser.GetCurrentAUsReg(), face_analyser.GetCurrentAUsClass()); // Setting up the recorder output open_face_rec.SetObservationHOG(face_model.detection_success, hog_descriptor, num_hog_rows, num_hog_cols, 31); // The number of channels in HOG is fixed at the moment, as using FHOG diff --git a/exe/FaceLandmarkVidMulti/FaceLandmarkVidMulti.cpp b/exe/FaceLandmarkVidMulti/FaceLandmarkVidMulti.cpp index 2c7d7e5..abd8c93 100644 --- a/exe/FaceLandmarkVidMulti/FaceLandmarkVidMulti.cpp +++ b/exe/FaceLandmarkVidMulti/FaceLandmarkVidMulti.cpp @@ -332,6 +332,7 @@ int main (int argc, char **argv) visualizer.SetObservationLandmarks(face_models[model].detected_landmarks, face_models[model].detection_certainty); visualizer.SetObservationPose(LandmarkDetector::GetPose(face_models[model], sequence_reader.fx, sequence_reader.fy, sequence_reader.cx, sequence_reader.cy), face_models[model].detection_certainty); visualizer.SetObservationGaze(gaze_direction0, gaze_direction1, LandmarkDetector::CalculateAllEyeLandmarks(face_models[model]), LandmarkDetector::Calculate3DEyeLandmarks(face_models[model], sequence_reader.fx, sequence_reader.fy, sequence_reader.cx, sequence_reader.cy), face_models[model].detection_certainty); + visualizer.SetObservationActionUnits(face_analyser.GetCurrentAUsReg(), face_analyser.GetCurrentAUsClass()); // Output features open_face_rec.SetObservationHOG(face_models[model].detection_success, hog_descriptor, num_hog_rows, num_hog_cols, 31); // The number of channels in HOG is fixed at the moment, as using FHOG diff --git a/lib/local/Utilities/src/Visualizer.cpp b/lib/local/Utilities/src/Visualizer.cpp index ded10c6..c5dc183 100644 --- a/lib/local/Utilities/src/Visualizer.cpp +++ b/lib/local/Utilities/src/Visualizer.cpp @@ -366,11 +366,6 @@ void Visualizer::SetFps(double fps) char Visualizer::ShowObservation() { - if (vis_track) - { - cv::namedWindow("tracking_result", 1); - cv::imshow("tracking_result", captured_image); - } if (vis_align) { cv::imshow("sim_warp", aligned_face_image); @@ -381,8 +376,14 @@ char Visualizer::ShowObservation() } if (vis_aus) { + cv::namedWindow("action units", cv::WindowFlags::WINDOW_NORMAL); cv::imshow("action units", action_units_image); } + if (vis_track) + { + cv::namedWindow("tracking result", cv::WindowFlags::WINDOW_NORMAL); + cv::imshow("tracking result", captured_image); + } return cv::waitKey(1); }