private void RealSenseProgram_OnFoundFace(object sender, FaceRecognitionEventArgs args) { DrawInformation(args.Output); try { int UserId = args.Faces[0].QueryRecognition().QueryUserID(); if (UserId == -1) { label1.Text = "未註冊使用者"; CurrentName = ""; registerButton.Enabled = true; unregisterButton.Enabled = false; } else { string name; UserTable.TryGetValue(UserId, out name); CurrentName = name; label1.Text = name; registerButton.Enabled = true; unregisterButton.Enabled = true; } if (!CurentDataLocked) { Current = args.FirstRecognition; CurrentData = args.Output; } } catch { } DrawBitmap(); }
private void RealSenseProgram_OnNotFoundFace(object sender, FaceRecognitionEventArgs args) { label1.Text = "無使用者"; FaceImage = null; registerButton.Enabled = false; unregisterButton.Enabled = false; DrawInformation(args.Output); DrawBitmap(); }
private void RealSenseProgram_OnStart(object sender, FaceRecognitionEventArgs e) { #region 控制項作用切換 Invoke(new UpdatePanelDelegate(() => { DeviceToolStripMenuItem.Enabled = false; ResolutionToolStripMenuItem.Enabled = false; ModeToolStripMenuItem.Enabled = false; startButton.Enabled = false; stopButton.Enabled = true; registerButton.Enabled = true; unregisterButton.Enabled = true; })); #endregion }
private void RealSenseProgram_OnFrame(object sender, FaceRecognitionEventArgs args) { Image = args.Image; }