From d6654dec551bfce3373172ef3044feacc9cd4cfb Mon Sep 17 00:00:00 2001 From: Tadas Baltrusaitis Date: Fri, 19 Jan 2018 08:10:34 +0000 Subject: [PATCH] Towards HOG recording. --- gui/OpenFaceOffline/MainWindow.xaml.cs | 8 +++----- lib/local/CppInerop/FaceAnalyserInterop.h | 5 ++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gui/OpenFaceOffline/MainWindow.xaml.cs b/gui/OpenFaceOffline/MainWindow.xaml.cs index 04ffb30..0c6e554 100644 --- a/gui/OpenFaceOffline/MainWindow.xaml.cs +++ b/gui/OpenFaceOffline/MainWindow.xaml.cs @@ -39,8 +39,6 @@ using System.Threading; using System.Windows; using System.Windows.Threading; using System.Windows.Media.Imaging; -using System.IO; -using Microsoft.Win32; // Internal libraries using OpenCVWrappers; @@ -457,10 +455,10 @@ namespace OpenFaceOffline recorder.SetObservationActionUnits(au_regs, au_classes); recorder.SetObservationFaceAlign(face_analyser.GetLatestAlignedFace()); - + var hog_feature = face_analyser.GetLatestHOGFeature(); - //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 - + recorder.SetObservationHOG(success, hog_feature, face_analyser.GetHOGRows(), face_analyser.GetHOGCols(), face_analyser.GetHOGChannels()); + recorder.WriteObservation(); // TODO diff --git a/lib/local/CppInerop/FaceAnalyserInterop.h b/lib/local/CppInerop/FaceAnalyserInterop.h index efd74f2..8d54caa 100644 --- a/lib/local/CppInerop/FaceAnalyserInterop.h +++ b/lib/local/CppInerop/FaceAnalyserInterop.h @@ -335,7 +335,10 @@ public: return HOG_vis_image; } - OpenCVWrappers::RawImage^ GetLatestHOGFeature() { + OpenCVWrappers::RawImage^ GetLatestHOGFeature(System::Int32^ num_rows, System::Int32^ num_cols, System::Int32^ num_channels) { + num_rows = gcnew System::Int32(*this->num_rows); + num_cols = gcnew System::Int32(*this->num_cols); + num_channels = gcnew System::Int32(31); OpenCVWrappers::RawImage^ HOG_feature = gcnew OpenCVWrappers::RawImage(*hog_features); return HOG_feature; }