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

@ -29,7 +29,7 @@
<MenuItem Header="Open image sequence" Click="imageSequenceFileOpenClick">
</MenuItem>
</MenuItem>
<MenuItem Name="RecordingMenu" Header="Record">
<MenuItem Name="RecordingMenu" Header="Record" >
<MenuItem IsCheckable="True" Header="Record AUs" IsChecked="{Binding RecordAUs}"/>
<MenuItem IsCheckable="True" Header="Record pose" IsChecked="{Binding RecordPose}"/>
<MenuItem IsCheckable="True" Header="Record 2D landmarks" IsChecked="{Binding Record2DLandmarks}" />
@ -39,15 +39,15 @@
<MenuItem IsCheckable="True" Header="Record model parameters" IsChecked="{Binding RecordModelParameters}" />
<MenuItem IsCheckable="True" Header="Record aligned faces" IsChecked="{Binding RecordAligned}"/>
</MenuItem>
<MenuItem Name="SettingsMenu" Header="Recording settings">
<MenuItem Name="SettingsMenu" Header="Recording settings" >
<MenuItem Name="OutputLocationItem" Header="Set output location..." Click="OutputLocationItem_Click" ></MenuItem>
<MenuItem Header="Set output image size..." Click="setOutputImageSize_Click"></MenuItem>
</MenuItem>
<MenuItem Name="AUSetting" Header="AU settings">
<MenuItem Name="AUSetting" Header="AU settings" >
<MenuItem IsCheckable="True" Header="Use dynamic models" Click="UseDynamicModelsCheckBox_Click" IsChecked="{Binding DynamicAUModels}"/>
</MenuItem>
<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 Geometry" Click="VisualisationChange" IsChecked="{Binding ShowGeometry}"/>
<MenuItem IsCheckable="True" Header="Show AUs" Click="VisualisationChange" IsChecked="{Binding ShowAUs}"/>

View file

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