Ejemplo n.º 1
0
        public static void Write(string filename, string recordFilename)
        {
            var reader = new RecordReader(recordFilename);
            var frames = (from msg in reader.ReadAllMessages()
                          where msg is BodyFrameData
                          select (BodyFrameData)msg into frame
                          where frame.Bodies.Any(b => b.IsTracked)
                          select frame).ToArray();

            var body = frames[0].Bodies.FirstOrDefault(b => b.IsTracked);
            if (body != null)
            {
                var motion = new Motion(body, frames[0].RelativeTime);
                foreach (var frame in frames)
                {
                    motion.AppendFrame(frame.Bodies.First(b => b.TrackingId == body.TrackingId), frame.RelativeTime);
                }

                Write(filename, motion);
            }
        }