コード例 #1
0
        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();
        }
コード例 #2
0
 private void RealSenseProgram_OnNotFoundFace(object sender, FaceRecognitionEventArgs args)
 {
     label1.Text              = "無使用者";
     FaceImage                = null;
     registerButton.Enabled   = false;
     unregisterButton.Enabled = false;
     DrawInformation(args.Output);
     DrawBitmap();
 }
コード例 #3
0
 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
 }
コード例 #4
0
 private void RealSenseProgram_OnFrame(object sender, FaceRecognitionEventArgs args)
 {
     Image = args.Image;
 }