public void FaceRecognitionProgressThreadConstructorTest()
 {
     MainWindow window = new MainWindow();
     Nkujukira.Demo.Singletons.Singleton.InitializeStuff();
     FaceRecognitionProgressThread thread = new FaceRecognitionProgressThread();
     Assert.IsNotNull(thread);
     thread = null;
 }
 public void FaceRecognitionProgressThreadDoWorkTest()
 {
     MainWindow window = new MainWindow();
     Nkujukira.Demo.Singletons.Singleton.InitializeStuff();
     FaceRecognitionProgressThread thread = new FaceRecognitionProgressThread();
     thread.StartWorking();
     Assert.IsTrue(thread.IsRunning());
     thread.RequestStop();
 }
 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);
 }
Ejemplo n.º 4
0
        public static FaceRecognitionProgressThread CreateFaceRecogProgressThread()
        {
            face_recog_progress = new FaceRecognitionProgressThread();
            face_recog_progress_2 = new FaceRecognitionProgressThread();
            face_recog_progress.StartWorking();
            face_recog_progress_2.StartWorking();

            return face_recog_progress;
        }
Ejemplo n.º 5
0
        //THIS RELEASES ALL RESOURCES CONSUMED BY A THREAD GIVEN ITS ID
        public static bool ReleaseThreadResources(String thread_id)
        {
            switch (thread_id)
            {
                case ThreadFactory.PERP_ALERT_THREAD:

                    perp_alert_thread       = null;
                    break;

                case ThreadFactory.STUDENT_ALERT_THREAD:
                    student_alert_thread    = null;
                    break;

                case ThreadFactory.CAMERA_THREAD:
                    cam_output              = null;
                    break;

                case ThreadFactory.CAMERA_THREAD_USING_VIDEO:
                    cam_output_using_video  = null;
                    break;

                case ThreadFactory.LIVE_DISPLAY_UPDATER:
                    live_display_updater    = null;
                    break;

                case ThreadFactory.REVIEW_DISPLAY_UPDATER:
                    review_display_updater  = null;
                    break;

                case ThreadFactory.REVIEW_FACE_DETECTOR:
                    review_face_detector    = null;
                    break;

                case ThreadFactory.LIVE_FACE_DETECTOR:
                    live_face_detector      = null;
                    break;

                case ThreadFactory.PERP_RECOGNIZER:
                    perp_recognizer         = null;
                    break;

                case ThreadFactory.PROGRESS_THREAD:
                    face_recog_progress     = null;
                    face_recog_progress_2   = null;
                    break;

                case ThreadFactory.FACE_DRAWER:
                    face_drawer             = null;
                    break;

                case ThreadFactory.FOOTAGE_SAVER:
                    footage_saver           = null;
                    break;

                case ThreadFactory.VIDEO_THREAD:
                    video_from_file_grabber = null;
                    break;

                case ThreadFactory.VIDEO_THREAD_USING_CAMERA:
                    video_from_camera       = null;
                    break;
            }
            return true;
        }