GetMetaData() публичный Метод

public GetMetaData ( ) : ImageMetaData
Результат ImageMetaData
Пример #1
0
        public void Initialize()
        {
            context = new Context(@"..\..\..\data\openniconfig.xml");
            depth = context.FindExistingNode(NodeType.Depth) as DepthGenerator;
            rgb = context.FindExistingNode(NodeType.Image) as ImageGenerator;
            if (depth == null)
                throw new Exception(@"Error in Data\openniconfig.xml. No depth node found.");
            if (rgb == null)
                throw new Exception(@"Error in Data\openniconfig.xml. No rgb node found.");
            MapOutputMode mapMode = depth.GetMapOutputMode();

            // Initialize member variables
            depthHistogram = new int[depth.GetDeviceMaxDepth()];

            // initialize rgb array
            xn.ImageMetaData rgbMD = rgb.GetMetaData();
            rgbData = new byte[rgbMD.XRes * rgbMD.YRes * 3];
            rgbWidth = rgbMD.XRes;
            rgbHeight = rgbMD.YRes;

            xn.DepthMetaData depthMD = depth.GetMetaData();
            depthData = new ushort[depthMD.XRes * depthMD.YRes];
            oldDepthData = new ushort[depthMD.XRes * depthMD.YRes];
            histogramImage = new byte[depthMD.XRes * depthMD.YRes * 3];
            depthWidth = depthMD.XRes;
            depthHeight = depthMD.YRes;
            depthOffsetX = depthMD.XOffset;
            depthOffsetY = depthMD.YOffset;

            DispatcherTimer dispatcherTimer = new DispatcherTimer();
            dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
            dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 30);
            dispatcherTimer.Start();
        }
Пример #2
0
        private void InitOpenNi(AsyncStateData asyncData)
        {
            _niContext = new Context("openni.xml");

            _imageNode = (ImageGenerator)_niContext.FindExistingNode(NodeType.Image);

            _imageMeta = new ImageMetaData();
            _imageNode.GetMetaData(_imageMeta);

            // create the image bitmap source on
            asyncData.AsyncOperation.SynchronizationContext.Send(
                md => CreateImageBitmap(_imageMeta, out _rgbImageSource),
                null);

            // add depth node
            _depthNode = (DepthGenerator)_niContext.FindExistingNode(NodeType.Depth);

            _depthMeta = new DepthMetaData();
            _depthNode.GetMetaData(_depthMeta);

            asyncData.AsyncOperation.SynchronizationContext.Send(
                state => CreateImageBitmap(_depthMeta, out _depthImageSource, PixelFormats.Pbgra32),
                null);

            // add scene node
            //_sceneNode = (SceneAnalyzer) _niContext.FindExistingNode(NodeType.Scene);

            //_sceneMeta = new SceneMetaData();
            ////_sceneNode.GetMetaData(_sceneMeta);

            //asyncData.AsyncOperation.SynchronizationContext.Send(
            //    state => CreateImageBitmap(_sceneMeta, out _sceneImageSource, PixelFormats.Pbgra32),
            //    null);
        }