Example #1
0
        private void capture()
        {
            if (System.Configuration.ConfigurationManager.AppSettings["Verify"] != "file")
            {
                if (_camera == null)
                {
                    LogLine("No camera set", true);
                    return;
                }

                try
                {
                    if (_pendingFormat != null)
                    {
                        _camera.SetCurrentFormat(_pendingFormat);
                        _pendingFormat = null;
                    }

                    _camera.StartCapturing();
                    UpdateFormatList();
                    startCapturing();
                }
                catch (Exception ex)
                {
                    ShowError(ex.Message);
                }
            }
            else
            {
                enrollFromImage(true);  // to view2
                score = Identify(_capturedTemplateList, _enrolledTemplateList);
                LogLine(string.Format("Face match details: score {0}.", score), true);
                backgroundWorker_RunWorkerCompleted(null, null);
            }
        }