protected override void DisplayDetails()
        {
            //IF THIS ALERT IS BECOZ A PERP HAS BEEN IDENTIFIED
            if (face_recog_result != null)
            {

                //ADD THE ID OF THE PERP SO WE CAN TRACK IT FOR LATER
                ids_of_perps.Add(face_recog_result.identified_perpetrator.id);

                //DISPLAY VISUAL CUES ON THE MAIN GUI THAT AN ALERT HAS BEEN TRIGGERED
                MyImageBox alert_image_box=(MyImageBox)Singleton.MAIN_WINDOW.GetControl(MainWindow.MainWindowControls.live_stream_image_box1);

                alert_image_box.EnableAlertMode();

                //create form
                PerpetratorAertForm form = new PerpetratorAertForm(face_recog_result);

                //show details form
                form.ShowDialog();

                return;
            }

            face_recog_result                 = null;
        }
 public void FaceRecognitionProgressThreadDisplayFaceRecognitionProgressTest()
 {
     MainWindow window = new MainWindow();
     Nkujukira.Demo.Singletons.Singleton.InitializeStuff();
     FaceRecognitionProgressThread thread = new FaceRecognitionProgressThread();
     FaceRecognitionResult result = new FaceRecognitionResult();
     result.id = 1;
     Image<Bgr, byte>[] faces = { Singleton.FACE_PIC };
     result.identified_perpetrator = new Perpetrator(faces,false,"Male");
     result.match_was_found = false;
     result.original_detected_face = Singleton.FACE_PIC;
     result.similarity = 0.0f;
     thread.face_recognition_result = result;
     bool sucess=thread.DisplayFaceRecognitionProgress(Singleton.FACE_PIC);
 }
示例#3
0
        protected override void DisplayDetails()
        {
            //IF ITS BECOZ A STUDENT HAS BEEN IDENTIFIED
            if (face_recog_result != null)
            {
                //ADD THE ID OF THE STUDENT SO WE CAN TRACK IT FOR LATER
                ids_of_students.Add(face_recog_result.id);

                //create form
                StudentAlertForm form = new StudentAlertForm(face_recog_result);

                //show details form
                form.ShowDialog();

                return;
            }
            face_recog_result             = null;
        }
        protected override void RecognizeFace(Image<Bgr, byte> face)
        {
            if (students.Length != 0)
            {

                //RESIZE THE FACE TO BE RECOGNIZED SO ITS EQUAL TO THE FACES ALREADY IN THE TRAINING SET
                int width               = 120;
                int height              = 120;

                face                    = FramesManager.ResizeColoredImage(face, new Size(width, height));

                //ATTEMPT TO RECOGNIZE THE PERPETRATOR
                face_recognition_result = faces_manager.MatchFace(face);

                //IF A VALID ID IS RETURMED
                if (face_recognition_result.match_was_found)
                {
                    //GET STUDENT ASSOCIATED WITH ID
                    foreach (var student in students)
                    {
                        if (student.id == face_recognition_result.id)
                        {
                            face_recognition_result.identified_student = student;
                            break;
                        }
                    }
                }

                return;
            }
        }
示例#5
0
 public StudentAlertForm(FaceRecognitionResult result)
 {
     this.result = result;
     InitializeComponent();
 }