コード例 #1
0
        public FaceSearchFacade(Damany.Imaging.Processors.MotionDetector motionDetector,
            Damany.Imaging.Processors.PortraitFinder portraitFinder,
            IEnumerable<Damany.Imaging.Common.IFacePostFilter> facePostFilters,
            FaceComparer faceComparer,
            IEventAggregator eventAggregator)
        {
            _motionDetector = motionDetector;
            _portraitFinder = portraitFinder;
            _facePostFilters = facePostFilters;
            _eventAggregator = eventAggregator;
            _faceComparer = faceComparer;

            MotionQueueSize = 10;

            Rectangle rectangle = GetRoi();

            _portraitFinder.ROI = rectangle;
        }
コード例 #2
0
        public static FaceSearchController CreateNewController(IFrameStream source)
        {
            PortraitFinder finder = new PortraitFinder();

            MotionDetector motionDetector = new MotionDetector();
            motionDetector.MotionFrameCaptured += finder.HandleMotionFrame;

            Damany.Util.PersistentWorker retriever = CreateDriver(source, motionDetector);

            var controller = new FaceSearchController()
            {
                Worker = retriever,
                PortraitFinder = finder,
                MotionDetector = motionDetector
            };

            return controller;
        }
コード例 #3
0
        public FaceSearchFacade(Damany.Imaging.Processors.MotionDetector motionDetector,
                                Damany.Imaging.Processors.PortraitFinder portraitFinder,
                                IEnumerable <Damany.Imaging.Common.IFacePostFilter> facePostFilters,
                                FaceComparer faceComparer,
                                IEventAggregator eventAggregator)
        {
            _motionDetector  = motionDetector;
            _portraitFinder  = portraitFinder;
            _facePostFilters = facePostFilters;
            _eventAggregator = eventAggregator;
            _faceComparer    = faceComparer;

            MotionQueueSize = 10;

            Rectangle rectangle = GetRoi();

            _portraitFinder.ROI = rectangle;
        }
コード例 #4
0
        public static FaceSearchController CreateNewController(IFrameStream source)
        {
            PortraitFinder finder = new PortraitFinder();

            MotionDetector motionDetector = new MotionDetector();

            motionDetector.MotionFrameCaptured += finder.HandleMotionFrame;

            Damany.Util.PersistentWorker retriever = CreateDriver(source, motionDetector);

            var controller = new FaceSearchController()
            {
                Worker         = retriever,
                PortraitFinder = finder,
                MotionDetector = motionDetector
            };

            return(controller);
        }
コード例 #5
0
        public void Test()
        {
            var source = new DirectoryFilesCamera(@"z:\", "*.jpg");
            source.Initialize();

            var motionFrameLogger = new FrameWritter();

            var portraitWriter = new PortraitsLogger(@".\Portrait");
            portraitWriter.Initialize();

            var asyncPortraitWriter = new AsyncPortraitLogger(@".\AsyncPortrait1");
            asyncPortraitWriter.Stopped += (o, e) => System.Diagnostics.Debug.WriteLine(e.Value.Message);
            asyncPortraitWriter.Initialize();

            var asyncWriter1 = new AsyncPortraitLogger(@".\asyncport2");
            asyncWriter1.Initialize();

            var portraitFinder = new PortraitFinder();
            portraitFinder.AddListener(asyncPortraitWriter);
            //             portraitFinder.AddListener(portraitWriter);
            //             portraitFinder.AddListener(asyncWriter1);

            asyncPortraitWriter.Start();

            bool running = true;
            for (int i = 0; i < 25 && running;++i )
            {
                var frame = source.RetrieveFrame();

                if (i %10 ==0 )
                {
                    asyncPortraitWriter.Stop();
                    portraitFinder.AddListener(asyncPortraitWriter);
                    asyncPortraitWriter.Start();
                }
            }
        }