Example #1
0
        public static async Task <Session> Start(CameraObject cameraObject, string name, string fileOutput = null)
        {
            if (sourcesOpen.Any(i => i.Equals(cameraObject.Name)))
            {
                return(null);
            }
            var session = new Session()
            {
                IsSourceFromCamera = true,
                Source             = cameraObject.ToString(),
                FileOutput         = fileOutput,
                Name = name
            };

            session.Datastore = await Datastore.Initialize(session);

            session.FrameSource = await FrameSource.Initialize(session);

            session.GridProjection = await GridProjection.Initialize(session);

            session.Logger = await Logger.Initialize(session);

            session.HumanDetector = await HumanDetector.Initialize(session);

            sourcesOpen.Add(cameraObject.ToString());
            return(session);
        }
        public static async Task <GridProjection> Initialize(Session session)
        {
            var grid = new GridProjection()
            {
                session = session
            };

            _ = grid.MaxNormWidth;
            _ = grid.MaxNormHeight;
            _ = grid.BL;
            _ = grid.TL;
            _ = grid.TR;
            _ = grid.BR;
            _ = grid.TopBottomDistance;
            _ = grid.LeftRightDistance;
            return(await Task.FromResult(grid));
        }