/// <summary> /// Default constructor. /// </summary> public StreamViewer() { InitializeComponent(); _analyzer = new BlobDetectionAnalysis(45, 45, 400, 400, 15, .3f, 0.45f); _players = new List<IPlayer> { new Player(System.Guid.NewGuid(), "Test Player 1", Color.FromArgb(137, 155, 180)) };//, //new Player(System.Guid.NewGuid(), "Test Player 2", Color.FromArgb(164, 105, 116)) }; //_videoInput = new BitmapCamera("D:\\My Documents\\Senior Design\\repo\\trunk\\test_files\\Green_Blob\\cap", 850, 200); _videoInput = new DSCapture(0, 0, 0, 0); _videoInput.VideoEventHandler += FrameUpdateHandler; }
private string GetVideoName(IVideoInput vi) { string res = vi.Name.Substring(0, Math.Min(15, vi.Name.Length)); if (vi.Filters != null) { if (vi.Filters.FlipH) { res += ",flip"; } if (vi.Filters.Items != null) { res += string.Join(",", vi.Filters.Items.Select(s => $"{s.Name}={s.Value}")); } } return(res); }
public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); const int VIDEODEVICE = 0; // zero based index of video capture device to use const int VIDEOWIDTH = 640; // Depends on video device caps const int VIDEOHEIGHT = 480; // Depends on video device caps const int VIDEOBITSPERPIXEL = 24; // BitsPerPixel values determined by device _cam = new DSCapture(VIDEODEVICE, VIDEOWIDTH, VIDEOHEIGHT, VIDEOBITSPERPIXEL); _cam.VideoEventHandler += FrameUpdateHandler; _cam.Start(); }