Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #506, only adds camera with positive width and height #841

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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