Esempio n. 1
0
        private void ProcessFrame(object sender, EventArgs e)
        {
            if (captureSate)
            {
                currentFrame = capture.QueryFrame().Resize(320, 240, Emgu.CV.CvEnum.INTER.CV_INTER_CUBIC);
                facCon.StartFacerecognition(currentFrame);
                capimagebox.Image = facCon.getCurrentRecognitionImage();
                facCon.SetNameAsempty();

                if (BactCode.Text != "")
                {
                    id = facCon.UserID();
                    if (id != 0)
                    {
                        if (facCon.CheckPresent(id))
                        {
                            if (facCon.getBatchCode(id) == BactCode.Text)
                            {
                                Registermess.Text = "Registered :)  See you soon ";
                                disImage.Image    = Image.FromFile(Application.StartupPath + "/faces/" + id + ".png");
                                facCon.AddToMArksSheet(id, facCon.getBatchCode(id), facCon.getCurrentTime(), facCon.getCurrentDate());
                                Registermess.Text = "Next Pelase....";
                            }
                            else
                            {
                                Registermess.Text = "Sorry This is not your batch";
                            }
                        }
                        else
                        {
                            Registermess.Text = "Your Mark is completed";
                            disImage.Hide();
                        }
                    }
                }
            }
        }