public void ReviewFaceDetectingThreadDoWorkTest()
 {
     Nkujukira.Demo.Singletons.Singleton.HAARCASCADE_FILE_PATH = Singleton.HAARCASCADE_FILE_PATH;
     ReviewFaceDetectingThread thread = new ReviewFaceDetectingThread(10, 10);
     thread.StartWorking();
     Assert.IsTrue(thread.IsRunning());
 }
 public void ReviewFaceDetectingThreadDetectFacesInFrameTest()
 {
     Nkujukira.Demo.Singletons.Singleton.HAARCASCADE_FILE_PATH = Singleton.HAARCASCADE_FILE_PATH;
     ReviewFaceDetectingThread thread = new ReviewFaceDetectingThread(10, 10);
     Nkujukira.Demo.Singletons.Singleton.REVIEW_FRAMES_TO_BE_PROCESSED.Enqueue(Singleton.FACE_PIC);
     bool sucess= thread.DetectFacesInFrame();
     Assert.IsTrue(sucess);
 }
Beispiel #3
0
        //STARTS THREAD TO DETECT FACES IN FRAME OFF THE MAIN THREAD
        private static ReviewFaceDetectingThread CreateReviewFaceDetectingThread()
        {
            var controls_name = MainWindow.MainWindowControls.review_image_box;
            int width = Singleton.MAIN_WINDOW.GetControl(controls_name).Width;
            int height = Singleton.MAIN_WINDOW.GetControl(controls_name).Width;
            Size frame_size = new Size(width, height);
            review_face_detector = new ReviewFaceDetectingThread(frame_size);
            review_face_detector.StartWorking();

            return review_face_detector;
        }
Beispiel #4
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;
        }
 public void ReviewFaceDetectingThreadConstructorTest()
 {
     Nkujukira.Demo.Singletons.Singleton.HAARCASCADE_FILE_PATH = Singleton.HAARCASCADE_FILE_PATH;
     ReviewFaceDetectingThread thread = new ReviewFaceDetectingThread(10,10);
     Assert.IsNotNull(thread);
 }