Skip to content

Commit

Permalink
Fixes #506, only adds camera with positive width and height
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilGauthier committed Feb 24, 2020
1 parent ad1b3cc commit 02f572b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions gui/OpenFaceOffline/UI_items/CameraSelection.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,15 @@ public void PopulateCameraSelections()
{
String root = AppDomain.CurrentDomain.BaseDirectory;
//cams = CameraInterop.Capture.GetCameras(root);
cams = UtilitiesOF.SequenceReader.GetCameras(root);
}
List<Tuple<int, String, List<Tuple<int, int>>, OpenCVWrappers.RawImage>> camsTmp;
camsTmp = UtilitiesOF.SequenceReader.GetCameras(root);
cams = new List<Tuple<int, String, List<Tuple<int, int>>, OpenCVWrappers.RawImage>>();
foreach (var s in camsTmp)
{
if ( s.Item4.Width > 0 && s.Item4.Height > 0)
cams.Add(s);
}
}

int i = 0;

Expand All @@ -62,7 +69,8 @@ public void PopulateCameraSelections()

foreach (var s in cams)
{

/*if (s.Item4.Width <= 0 || s.Item4.Height <= 0)
continue;*/
var b = s.Item4.CreateWriteableBitmap();
s.Item4.UpdateWriteableBitmap(b);
b.Freeze();
Expand Down

0 comments on commit 02f572b

Please sign in to comment.