Exemplo n.º 1
0
        /// <summary>
        /// 获取1帧图片,用于之后的保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void grab_button_Click(object sender, EventArgs e)
        {
            List <Mat> dstFaces = faceDetect.GetFaces(img, faces);

            if (dstFaces.Count > 0)
            {
                grabBox.Image = dstFaces[0].ToBitmap();
                saveMat       = dstFaces[0];
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 获取1帧图片,用于之后的保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void grab_button_Click(object sender, EventArgs e)
        {
            List <Mat> dstFaces = faceDetect.GetFaces(img, faces);

            if (dstFaces.Count > 0)
            {
                grabBox.Image = dstFaces[0].ToBitmap();
                saveMat       = dstFaces[0].Clone();
            }
            foreach (var x in dstFaces)
            {
                x.Dispose();
            }
        }