Merge branch 'feature/Windows-GUI' of https://github.com/TadasBaltrusaitis/OpenFace into feature/Windows-GUI

This commit is contained in:
Tadas Baltrusaitis 2018-01-29 16:58:02 +00:00
commit 70ce4fc39f
3 changed files with 16 additions and 4 deletions

View file

@ -227,7 +227,7 @@ namespace OpenFaceOffline
VisualizeFeatures(frame, visualizer_of, landmark_detector.CalculateAllLandmarks(), detection_succeeding, true, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy(), progress); VisualizeFeatures(frame, visualizer_of, landmark_detector.CalculateAllLandmarks(), detection_succeeding, true, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy(), progress);
// Record an observation // Record an observation
RecordObservation(recorder, visualizer_of.GetVisImage(), detection_succeeding, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy()); RecordObservation(recorder, visualizer_of.GetVisImage(), detection_succeeding, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy(), reader.GetTimestamp());
while (thread_running & thread_paused && skip_frames == 0) while (thread_running & thread_paused && skip_frames == 0)
{ {
@ -330,7 +330,7 @@ namespace OpenFaceOffline
VisualizeFeatures(frame, visualizer_of, landmarks, detection_succeeding, i == 0, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy(), progress); VisualizeFeatures(frame, visualizer_of, landmarks, detection_succeeding, i == 0, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy(), progress);
// Record an observation // Record an observation
RecordObservation(recorder, visualizer_of.GetVisImage(), detection_succeeding, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy()); RecordObservation(recorder, visualizer_of.GetVisImage(), detection_succeeding, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy(), 0);
} }
@ -354,9 +354,11 @@ namespace OpenFaceOffline
} }
private void RecordObservation(RecorderOpenFace recorder, RawImage vis_image, 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 timestamp)
{ {
recorder.SetObservationTimestamp(timestamp);
double confidence = landmark_detector.GetConfidence(); double confidence = landmark_detector.GetConfidence();
List<double> pose = new List<double>(); List<double> pose = new List<double>();
@ -366,7 +368,7 @@ namespace OpenFaceOffline
List<Tuple<double, double>> landmarks_2D = landmark_detector.CalculateAllLandmarks(); List<Tuple<double, double>> landmarks_2D = landmark_detector.CalculateAllLandmarks();
List<Tuple<double, double, double>> landmarks_3D = landmark_detector.Calculate3DLandmarks(fx, fy, cx, cy); List<Tuple<double, double, double>> landmarks_3D = landmark_detector.Calculate3DLandmarks(fx, fy, cx, cy);
List<double> global_params = landmark_detector.GetRigidParams(); List<double> global_params = landmark_detector.GetRigidParams();
List<double> local_params = landmark_detector.GetParams(); List<double> local_params = landmark_detector.GetNonRigidParams();
recorder.SetObservationLandmarks(landmarks_2D, landmarks_3D, global_params, local_params, confidence, success); recorder.SetObservationLandmarks(landmarks_2D, landmarks_3D, global_params, local_params, confidence, success);

View file

@ -148,6 +148,11 @@ namespace UtilitiesOF {
} }
// Setting the observations // Setting the observations
void SetObservationTimestamp(double timestamp)
{
m_recorder->SetObservationTimestamp(timestamp);
}
void SetObservationPose(List<double>^ pose) void SetObservationPose(List<double>^ pose)
{ {
cv::Vec6d pose_vec(pose[0], pose[1], pose[2], pose[3], pose[4], pose[5]); cv::Vec6d pose_vec(pose[0], pose[1], pose[2], pose[3], pose[4], pose[5]);

View file

@ -159,6 +159,11 @@ namespace UtilitiesOF {
return m_rgb_frame; return m_rgb_frame;
} }
double GetTimestamp()
{
return m_sequence_capture->time_stamp;
}
System::String^ GetName() System::String^ GetName()
{ {
std::string filename = m_sequence_capture->name; std::string filename = m_sequence_capture->name;