diff --git a/gui/OpenFaceOffline/MainWindow.xaml.cs b/gui/OpenFaceOffline/MainWindow.xaml.cs index bc8c206..f92d925 100644 --- a/gui/OpenFaceOffline/MainWindow.xaml.cs +++ b/gui/OpenFaceOffline/MainWindow.xaml.cs @@ -498,8 +498,7 @@ namespace OpenFaceOffline visualizer.SetObservationHOG(face_analyser.GetLatestHOGFeature(), face_analyser.GetHOGRows(), face_analyser.GetHOGCols()); visualizer.SetObservationLandmarks(landmarks, confidence); // Set confidence to high to make sure we always visualize visualizer.SetObservationPose(pose, confidence); - //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.SetObservationGaze(gaze_analyser.GetGazeCamera().Item1, gaze_analyser.GetGazeCamera().Item2, clnf_model.CalculateAllEyeLandmarks(), clnf_model.CalculateAllEyeLandmarks3D(fx, fy, cx, cy), confidence); if (detectionSucceeding) { @@ -618,7 +617,7 @@ namespace OpenFaceOffline if (ShowAppearance) { RawImage aligned_face = face_analyser.GetLatestAlignedFace(); - RawImage hog_face = face_analyser.GetLatestHOGDescriptorVisualisation(); + RawImage hog_face = visualizer.GetHOGVis(); if (latest_aligned_face == null) { diff --git a/lib/local/CppInerop/FaceAnalyserInterop.h b/lib/local/CppInerop/FaceAnalyserInterop.h index 089663d..3573241 100644 --- a/lib/local/CppInerop/FaceAnalyserInterop.h +++ b/lib/local/CppInerop/FaceAnalyserInterop.h @@ -329,11 +329,6 @@ public: OpenCVWrappers::RawImage^ face_aligned_image = gcnew OpenCVWrappers::RawImage(*aligned_face); return face_aligned_image; } - - OpenCVWrappers::RawImage^ GetLatestHOGDescriptorVisualisation() { - OpenCVWrappers::RawImage^ HOG_vis_image = gcnew OpenCVWrappers::RawImage(*visualisation); - return HOG_vis_image; - } OpenCVWrappers::RawImage^ GetLatestHOGFeature() { OpenCVWrappers::RawImage^ HOG_feature = gcnew OpenCVWrappers::RawImage(*hog_features); diff --git a/lib/local/CppInerop/VisualizerInterop.h b/lib/local/CppInerop/VisualizerInterop.h index a5728f4..1c8033c 100644 --- a/lib/local/CppInerop/VisualizerInterop.h +++ b/lib/local/CppInerop/VisualizerInterop.h @@ -113,6 +113,18 @@ namespace UtilitiesOF { m_visualizer->SetObservationLandmarks(landmarks_2D_mat, confidence); } + OpenCVWrappers::RawImage^ GetHOGVis() + { + OpenCVWrappers::RawImage^ hog_image = gcnew OpenCVWrappers::RawImage(m_visualizer->GetHOGVis()); + return hog_image; + } + + OpenCVWrappers::RawImage^ GetVisImage() + { + OpenCVWrappers::RawImage^ vis_image = gcnew OpenCVWrappers::RawImage(m_visualizer->GetVisImage()); + return vis_image; + } + // Finalizer. Definitely called before Garbage Collection, // but not automatically called on explicit Dispose(). // May be called multiple times. diff --git a/lib/local/Utilities/include/Visualizer.h b/lib/local/Utilities/include/Visualizer.h index 1197cf2..813a5e4 100644 --- a/lib/local/Utilities/include/Visualizer.h +++ b/lib/local/Utilities/include/Visualizer.h @@ -82,6 +82,7 @@ namespace Utilities char ShowObservation(); cv::Mat GetVisImage(); + cv::Mat GetHOGVis(); // Keeping track of what we're visualizing bool vis_track; diff --git a/lib/local/Utilities/src/Visualizer.cpp b/lib/local/Utilities/src/Visualizer.cpp index bba6776..69313b4 100644 --- a/lib/local/Utilities/src/Visualizer.cpp +++ b/lib/local/Utilities/src/Visualizer.cpp @@ -292,3 +292,8 @@ cv::Mat Visualizer::GetVisImage() { return captured_image; } + +cv::Mat Visualizer::GetHOGVis() +{ + return hog_image; +}