More binding and simplification

This commit is contained in:
Tadas Baltrusaitis 2016-12-08 16:43:29 -05:00
parent 99191fd3c9
commit 3b1770c106
2 changed files with 15 additions and 18 deletions

View file

@ -47,7 +47,7 @@
<MenuItem IsCheckable="True" Header="Use dynamic models" Click="UseDynamicModelsCheckBox_Click" IsChecked="{Binding DynamicAUModels}"/> <MenuItem IsCheckable="True" Header="Use dynamic models" Click="UseDynamicModelsCheckBox_Click" IsChecked="{Binding DynamicAUModels}"/>
</MenuItem> </MenuItem>
<MenuItem Header="View"> <MenuItem Header="View">
<MenuItem IsCheckable="True" Header="Show Video" Click="VisualisationChange" IsChecked="{Binding ShowVideo}"/> <MenuItem IsCheckable="True" Header="Show Video" Click="VisualisationChange" IsChecked="{Binding ShowTrackedVideo}"/>
<MenuItem IsCheckable="True" Header="Show Appearance" Click="VisualisationChange" IsChecked="{Binding ShowAppearance}"/> <MenuItem IsCheckable="True" Header="Show Appearance" Click="VisualisationChange" IsChecked="{Binding ShowAppearance}"/>
<MenuItem IsCheckable="True" Header="Show Geometry" Click="VisualisationChange" IsChecked="{Binding ShowGeometry}"/> <MenuItem IsCheckable="True" Header="Show Geometry" Click="VisualisationChange" IsChecked="{Binding ShowGeometry}"/>
<MenuItem IsCheckable="True" Header="Show AUs" Click="VisualisationChange" IsChecked="{Binding ShowAUs}"/> <MenuItem IsCheckable="True" Header="Show AUs" Click="VisualisationChange" IsChecked="{Binding ShowAUs}"/>

View file

@ -222,12 +222,12 @@ namespace OpenFaceOffline
if (capture.isOpened()) if (capture.isOpened())
{ {
// Prepare recording if any based on the directory, TODO move this // Prepare recording if any based on the directory
String file_no_ext = System.IO.Path.GetDirectoryName(filenames[0]); String file_no_ext = System.IO.Path.GetDirectoryName(filenames[0]);
file_no_ext = System.IO.Path.GetFileName(file_no_ext); file_no_ext = System.IO.Path.GetFileName(file_no_ext);
// Start the actual processing // Start the actual processing and recording
VideoLoop(); VideoLoop(file_no_ext);
} }
else else
@ -288,11 +288,10 @@ namespace OpenFaceOffline
if (capture.isOpened()) if (capture.isOpened())
{ {
// Prepare recording if any TODO move this
String file_no_ext = System.IO.Path.GetFileNameWithoutExtension(filename); String file_no_ext = System.IO.Path.GetFileNameWithoutExtension(filename);
// Start the actual processing // Start the actual processing
VideoLoop(); VideoLoop(file_no_ext);
} }
else else
@ -397,7 +396,7 @@ namespace OpenFaceOffline
// Capturing and processing the video frame by frame // Capturing and processing the video frame by frame
private void VideoLoop() private void VideoLoop(string output_file_name)
{ {
Thread.CurrentThread.IsBackground = true; Thread.CurrentThread.IsBackground = true;
@ -419,8 +418,8 @@ namespace OpenFaceOffline
double cx = capture.width / 2f; double cx = capture.width / 2f;
double cy = capture.height / 2f; double cy = capture.height / 2f;
// Setup the recorder first, TODO change // Setup the recorder first
recorder = new Recorder(record_root, "test.txt", capture.width, capture.height, Record2DLandmarks, Record3DLandmarks, RecordModelParameters, RecordPose, recorder = new Recorder(record_root, output_file_name, capture.width, capture.height, Record2DLandmarks, Record3DLandmarks, RecordModelParameters, RecordPose,
RecordAUs, RecordGaze, RecordAligned, RecordHOG, clnf_model, face_analyser, fx, fy, cx, cy); RecordAUs, RecordGaze, RecordAligned, RecordHOG, clnf_model, face_analyser, fx, fy, cx, cy);
int frame_id = 0; int frame_id = 0;
@ -633,6 +632,7 @@ namespace OpenFaceOffline
} }
recorder.FinishRecording(clnf_model, face_analyser); recorder.FinishRecording(clnf_model, face_analyser);
} }
private void StopTracking() private void StopTracking()
@ -672,7 +672,7 @@ namespace OpenFaceOffline
private void SetupImageMode() private void SetupImageMode()
{ {
// Turn off unneeded visualisations, TODO remove dispatch // Turn off unneeded visualisations
ShowTrackedVideo = true; ShowTrackedVideo = true;
ShowAppearance = false; ShowAppearance = false;
ShowGeometry = false; ShowGeometry = false;
@ -810,9 +810,6 @@ namespace OpenFaceOffline
NextFiveFramesButton.IsEnabled = false; NextFiveFramesButton.IsEnabled = false;
StopButton.IsEnabled = false; StopButton.IsEnabled = false;
ResetButton.IsEnabled = false; ResetButton.IsEnabled = false;
RecordingMenu.IsEnabled = true;
AUSetting.IsEnabled = true;
} }
} }