コード例 #1
0
        private void CreateParamsDetect()
        {
            Detect detect = new Detect();

            detect.configuration = "detect_configuration";
            ParamsDetect paramsDetect = new ParamsDetect();

            paramsDetect.accuracy       = 600;
            paramsDetect.maxeye         = 250;
            paramsDetect.maxfaces       = 1;
            paramsDetect.mineye         = 35;
            paramsDetect.modedetect     = 1;
            paramsDetect.extractionmode = 0;
            //paramsDetect.refreshInterval = 2000;
            detect.Params = paramsDetect;
            diskPresenter.SaveDetectConfiguration(detect);
        }
コード例 #2
0
        private void btnDetect_Click(object sender, EventArgs e)
        {
            if (VerifyInputDetect())
            {
                Detect   detect   = new Detect();
                Identify identify = new Identify();
                identify.configuration = "identify_configuration";
                detect.configuration   = "detect_configuration";
                ParamsIdentify paramsIdentify = new ParamsIdentify();
                ParamsDetect   paramsDetect   = new ParamsDetect();
                paramsDetect.accuracy       = Convert.ToInt16(txtAccurancy.Text);
                paramsDetect.maxeye         = Convert.ToInt16(txtMaxEye.Text);
                paramsDetect.maxfaces       = Convert.ToInt16(txtMaxDetect.Text);
                paramsDetect.mineye         = Convert.ToInt16(txtMinEye.Text);
                paramsDetect.extractionmode = cboExtractionMode.SelectedIndex;
                //paramsDetect.refreshInterval = Convert.ToInt16(txtTrackingRefresh.Text);
                paramsIdentify.A_MaxEyeDist            = Convert.ToInt16(txtMaxEye.Text);
                paramsIdentify.A_MinEyeDist            = Convert.ToInt16(txtMinEye.Text);
                paramsIdentify.A_FaceDetectionForced   = Convert.ToInt16(cboDetectForced.Text);
                paramsIdentify.A_IdentificationSpeed   = Convert.ToInt16(cboIdentificationSpeed.Text);
                paramsIdentify.A_SimilarityThreshold   = Convert.ToInt16(txtASimilarity.Text);
                paramsIdentify.A_FaceDetectThreshold   = Convert.ToInt16(txtAccurancy.Text);
                paramsIdentify.A_BestMatchedCandidates = Convert.ToInt16(txtBestMatched.Text);
                if (cboDetectorMode.SelectedIndex == 0)
                {
                    paramsDetect.modedetect = 1;
                }
                else
                {
                    paramsDetect.modedetect = 2;
                }

                detect.Params   = paramsDetect;
                identify.Params = paramsIdentify;
                diskPresenter.SaveDetectConfiguration(detect);
                diskPresenter.SaveIdentifyConfiguration(identify);
                this.lblOkDetect.Text = "Wait...";
                RequestAipu.Instance.StopAipu();
                Task.Delay(500).Wait();
                RequestAipu.Instance.ReloadAipu();
                this.lblOkDetect.Text = "OK";
            }
        }