Esempio n. 1
0
        public FaceCompare()
        {
            InitializeComponent();
            _accuracies = new[]{
                new Tuple<string, int>("低", 60),
                new Tuple<string, int>("中", 65),
                new Tuple<string, int>("高", 70),
            };

            _currentAccuracy = 65;

            this.searchFrom.EditValue = DateTime.Now.AddDays(-1);
            this.searchTo.EditValue = DateTime.Now;

            this.targetPic.Paint += new PaintEventHandler(targetPic_Paint);
            this.compareButton.Click += new EventHandler(compareButton_Click);

            if (_faceComparer == null)
            {
                _waitForm = new WaitDialogForm("初始化人脸特征库...", "请稍候");
                var modelPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "model.txt");
                var classifierPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "haarcascade_frontalface_alt2.xml");
                var comparer = FaceRecoWrapper.FromModel(modelPath, classifierPath);
                _faceComparer = comparer;
            }
        }
        public FaceCompare()
        {
            InitializeComponent();
            _accuracies = new[] {
                new Tuple <string, int>("低", 60),
                new Tuple <string, int>("中", 65),
                new Tuple <string, int>("高", 70),
            };

            _currentAccuracy = 65;

            this.searchFrom.EditValue = DateTime.Now.AddDays(-1);
            this.searchTo.EditValue   = DateTime.Now;

            this.targetPic.Paint     += new PaintEventHandler(targetPic_Paint);
            this.compareButton.Click += new EventHandler(compareButton_Click);

            if (_faceComparer == null)
            {
                _waitForm = new WaitDialogForm("初始化人脸特征库...", "请稍候");
                var modelPath      = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "model.txt");
                var classifierPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "haarcascade_frontalface_alt2.xml");
                var comparer       = FaceRecoWrapper.FromModel(modelPath, classifierPath);
                _faceComparer = comparer;
            }
        }
        public TargetPersonEditForm()
        {
            InitializeComponent();
            galleryControl1.Gallery.ItemCheckedChanged +=
                (s, e) => removeTarget.Enabled = galleryControl1.Gallery.Groups[0].GetCheckedItems().Count > 0;

            _waitForm = new WaitDialogForm("正在初始化,请稍候...", "请稍候");
            if (_faceComparer == null)
            {
                _waitForm.Caption = "正在初始化人像比对模块...";
                var modelPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "model.txt");
                var classifierPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "haarcascade_frontalface_alt2.xml");
                var comparer = FaceRecoWrapper.FromModel(modelPath, classifierPath);
                _faceComparer = comparer;
            }

            _waitForm.Caption = "正在载入目标人像库...";
            LoadTargets();
        }
        public TargetPersonEditForm()
        {
            InitializeComponent();
            galleryControl1.Gallery.ItemCheckedChanged +=
                (s, e) => removeTarget.Enabled          = galleryControl1.Gallery.Groups[0].GetCheckedItems().Count > 0;


            _waitForm = new WaitDialogForm("正在初始化,请稍候...", "请稍候");
            if (_faceComparer == null)
            {
                _waitForm.Caption = "正在初始化人像比对模块...";
                var modelPath      = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "model.txt");
                var classifierPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "haarcascade_frontalface_alt2.xml");
                var comparer       = FaceRecoWrapper.FromModel(modelPath, classifierPath);
                _faceComparer = comparer;
            }

            _waitForm.Caption = "正在载入目标人像库...";
            LoadTargets();
        }