示例#1
0
        /// <summary>
        /// 打开摄像头
        /// </summary>
        private void OpenCamera()
        {
            //call back function register
            camera.ImageCaptured += ShowImageInPictureBox;
            camera.FaceCaptured  += ShowFaceInPictureBox;

            //Open local pre-process
            camera.localFaceDetect         = true;
            camera.localFaceDistanceFilter = true;
            //设置人脸过滤的大小阈值, 100*100pixel的最小过滤框
            camera.SetThreshold(185);

            camera.Open();
            CameraCV.StartProcessOnFrame();
        }
示例#2
0
        /// <summary>
        /// 刷新picturebox任务,在timer中调用
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void pictureboxRefresh(object sender, EventArgs e)
        {
            if (camera.isOpen == false)
            {
                return;
            }

            if (camera.isProcessing == false)
            {
                SetPictureBox(pictureBoxCenter, new Bitmap("face.gif"));

                //SetPictureBoxVisibility(pictureBox2, false);

                SetTileButtonVisable(tileBtn, false);

                SetPictureBoxVisibility(loadBox_small, true);

                CameraCV.StartProcessOnFrame();

                SetMessageLabel(bunifuCustomLabel1, identify_hint_str);
            }
        }