Towards recording visualizations and cleaning old interop code.

This commit is contained in:
Tadas Baltrusaitis 2018-01-19 21:11:58 +00:00
parent 85262b72c7
commit 2513688463
2 changed files with 10 additions and 5 deletions

View file

@ -433,7 +433,7 @@ namespace OpenFaceOffline
}
private void RecordObservation(RecorderOpenFace recorder, bool success, float fx, float fy, float cx, float cy)
private void RecordObservation(RecorderOpenFace recorder, RawImage vis_image, bool success, float fx, float fy, float cx, float cy)
{
double confidence = clnf_model.GetConfidence();
@ -464,11 +464,11 @@ namespace OpenFaceOffline
var hog_feature = face_analyser.GetLatestHOGFeature();
recorder.SetObservationHOG(success, hog_feature, face_analyser.GetHOGRows(), face_analyser.GetHOGCols(), face_analyser.GetHOGChannels());
recorder.SetObservationVisualization(vis_image);
recorder.WriteObservation();
// TODO
//open_face_rec.SetObservationVisualization(visualizer.GetVisImage());
}
@ -494,7 +494,6 @@ namespace OpenFaceOffline
double scale = 0;
// Helps with recording and showing the visualizations
visualizer.SetObservationFaceAlign(face_analyser.GetLatestAlignedFace());
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);

View file

@ -176,6 +176,12 @@ namespace UtilitiesOF {
m_recorder->SetObservationFaceAlign(aligned_face_image->Mat);
}
void SetObservationVisualization(OpenCVWrappers::RawImage^ vis_image)
{
m_recorder->SetObservationVisualization(vis_image->Mat);
}
void SetObservationHOG(bool success, OpenCVWrappers::RawImage^ aligned_face_image, int num_cols, int num_rows, int num_channels)
{
m_recorder->SetObservationHOG(success, aligned_face_image->Mat, num_cols, num_rows, num_channels);