Exemplo n.º 1
0
        // --- init & enqueue
        public void Init()
        {
            // sizes & context
            coordMapper        = Context.KinectSensor.CoordinateMapper;
            colorWidth         = Context.ColorWidth;
            colorHeight        = Context.ColorHeight;
            depthWidth         = Context.DepthWidth;
            depthHeight        = Context.DepthHeight;
            colorResizedWidth  = Context.ColorResizedWidth;
            colorResizedHeight = Context.ColorResizedHeight;

            colorByteSize         = colorWidth * colorHeight * 4;
            colorPixelSize        = colorWidth * colorHeight;
            depthByteSize         = depthWidth * depthHeight;
            colorResizedByteSize  = colorResizedWidth * colorResizedHeight * 4;
            colorResizedPixelSize = colorResizedWidth * colorResizedHeight;

            psWidth  = Context.PsWidth;
            psHeight = Context.PsHeight;

            recorderPanel = Context.GUI.RecorderPanel;

            // codecs
            dctCodecs = new Dictionary <string, VideoCodec>();
            dctCodecs.Add(VideoCodec.H263P.ToString(), VideoCodec.H263P);
            dctCodecs.Add(VideoCodec.MPEG2.ToString(), VideoCodec.MPEG2);
            dctCodecs.Add(VideoCodec.MPEG4.ToString(), VideoCodec.MPEG4);
            dctCodecs.Add(VideoCodec.Raw.ToString(), VideoCodec.Raw);
            dctCodecs.Add(VideoCodec.WMV1.ToString(), VideoCodec.WMV1);
            dctCodecs.Add(VideoCodec.WMV2.ToString(), VideoCodec.WMV2);
        }
Exemplo n.º 2
0
        public static string GetFilePathBase(DateTime time, RecorderPanel recorderPanel)
        {
            // check base dir (database root dir)
            string dir = recorderPanel.Path;

            if (!Directory.Exists(dir))
            {
                throw new Exception("Invalid path");
            }

            // person -> session root dir
            string person = recorderPanel.Person;

            if (string.IsNullOrWhiteSpace(person))
            {
                throw new Exception("Please specify person");
            }
            person = person.Replace(' ', '_').Replace('-', '_').Replace('.', '_');

            // add subdir
            dir = Path.Combine(dir, String.Format("{0:yyyy_MM_dd}", time) + "_" + person);
            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);     // will throw exception if cant create
            }

            // modify concept according to naming rules
            string concept = recorderPanel.Concept;

            if (string.IsNullOrWhiteSpace(concept))
            {
                throw new Exception("Please specify concept");
            }
            concept = concept.ToLower();
            concept = concept.Replace(' ', '_').Replace('-', '_').Replace('.', '_');                                                                                                             // convert separators
            concept = concept.Replace('ę', 'e').Replace('ó', 'o').Replace('ą', 'a').Replace('ś', 's').Replace('ł', 'l').Replace('ż', 'z').Replace('ź', 'z').Replace('ć', 'c').Replace('ń', 'n'); // remove polish diactrics

            if (char.IsNumber(concept, 0))
            {
                concept = "liczebnik_" + concept;
            }

            // add subdir
            dir = Path.Combine(dir, concept);
            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);     // will throw exception if cant create
            }

            // fileNameBase
            string timeString = String.Format("{0:yyyy-MM-dd_HH-mm-ss}", time);
            //string filePath = Path.Combine(dir, concept + "_" + timeString + "_" + person);
            string filePath = Path.Combine(dir, timeString);

            return(filePath);
        }
        // --- init & enqueue
        public void Init()
        {
            // sizes & context
            coordMapper = Context.KinectSensor.CoordinateMapper;
            colorWidth = Context.ColorWidth;
            colorHeight = Context.ColorHeight;
            depthWidth = Context.DepthWidth;
            depthHeight = Context.DepthHeight;
            colorResizedWidth = Context.ColorResizedWidth;
            colorResizedHeight = Context.ColorResizedHeight;
            
            colorByteSize = colorWidth * colorHeight * 4;
            colorPixelSize = colorWidth * colorHeight;
            depthByteSize = depthWidth * depthHeight;
            colorResizedByteSize = colorResizedWidth * colorResizedHeight * 4;
            colorResizedPixelSize = colorResizedWidth * colorResizedHeight;

            psWidth = Context.PsWidth;
            psHeight = Context.PsHeight;

            recorderPanel = Context.GUI.RecorderPanel;

            // codecs
            dctCodecs = new Dictionary<string, VideoCodec>();
            dctCodecs.Add(VideoCodec.H263P.ToString(), VideoCodec.H263P);
            dctCodecs.Add(VideoCodec.MPEG2.ToString(), VideoCodec.MPEG2);
            dctCodecs.Add(VideoCodec.MPEG4.ToString(), VideoCodec.MPEG4);
            dctCodecs.Add(VideoCodec.Raw.ToString(), VideoCodec.Raw);
            dctCodecs.Add(VideoCodec.WMV1.ToString(), VideoCodec.WMV1);
            dctCodecs.Add(VideoCodec.WMV2.ToString(), VideoCodec.WMV2);
        }
Exemplo n.º 4
0
        public static string GetFilePathBase(DateTime time, RecorderPanel recorderPanel)
        {
            // check base dir (database root dir)
            string dir = recorderPanel.Path;
            if (!Directory.Exists(dir)) throw new Exception("Invalid path");

            // person -> session root dir
            string person = recorderPanel.Person;
            if (string.IsNullOrWhiteSpace(person)) throw new Exception("Please specify person");
            person = person.Replace(' ', '_').Replace('-', '_').Replace('.', '_');

            // add subdir
            dir = Path.Combine(dir, String.Format("{0:yyyy_MM_dd}", time) + "_" + person);
            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);     // will throw exception if cant create
            }

            // modify concept according to naming rules
            string concept = recorderPanel.Concept;
            if (string.IsNullOrWhiteSpace(concept)) throw new Exception("Please specify concept");
            concept = concept.ToLower();
            concept = concept.Replace(' ', '_').Replace('-', '_').Replace('.', '_');            // convert separators
            concept = concept.Replace('ę', 'e').Replace('ó', 'o').Replace('ą', 'a').Replace('ś', 's').Replace('ł', 'l').Replace('ż', 'z').Replace('ź', 'z').Replace('ć','c').Replace('ń', 'n');     // remove polish diactrics

            if (char.IsNumber(concept, 0))
            {
                concept = "liczebnik_" + concept;
            }

            // add subdir
            dir = Path.Combine(dir, concept);
            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);     // will throw exception if cant create
            }            

            // fileNameBase
            string timeString = String.Format("{0:yyyy-MM-dd_HH-mm-ss}", time);
            //string filePath = Path.Combine(dir, concept + "_" + timeString + "_" + person);
            string filePath = Path.Combine(dir, timeString);
            return filePath;
        }