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);
                faceController.StartFacerecognition(currentFrame);
                capimagebox.Image = faceController.GetRecognizedImage();
                faceController.SetNameAsempty();

                //check user recognized or not
                if (faceController.UserID() != 0)
                {
                    //recognized user alredy avaialebel in the system
                    if (!faceController.Checkperson(faceController.UserID(), batchCode.Text, subjectList.Text))
                    {
                        registerSucessMessage.Text = "Registered :)  See you soon ";
                        disImage.Image             = Image.FromFile(Application.StartupPath + "/faces/" + faceController.UserID() + "_A" + ".png");
                        faceController.AddStudentToSheet(faceController.UserID(), batchCode.Text, faceController.GetCurrentTime(), faceController.GetCurrentDate(), subjectList.Text);

                        parentNotify.SendMessage(faceController.GetMail(faceController.UserID().ToString()), DateTime.Now);
                        faceController.SetNameAsempty();
                        registerSucessMessage.Text = "Next Please ... ";

                        Thread.Sleep(5000);
                    }
                    else
                    {
                        disImage.InitialImage = null;
                        Thread.Sleep(5000);
                        registerSucessMessage.Text = string.Empty;
                    }
                }
            }
        }
Esempio n. 2
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();
                        }
                    }
                }
            }
        }