当前位置: 首页>>代码示例>>C#>>正文


C# Context.OpenFileRecording方法代码示例

本文整理汇总了C#中OpenNI.Context.OpenFileRecording方法的典型用法代码示例。如果您正苦于以下问题:C# Context.OpenFileRecording方法的具体用法?C# Context.OpenFileRecording怎么用?C# Context.OpenFileRecording使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenNI.Context的用法示例。


在下文中一共展示了Context.OpenFileRecording方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OpenNIContext

    // private ctor for singleton
    private OpenNIContext()
    {
        this.context = new Context();
        if (null == context)
        {
            return;
        }

        if (oniFile != "") {
            context.OpenFileRecording(oniFile);
        }

        // NITE license from OpenNI.org
        License ll = new License();
        ll.Key = "0KOIk2JeIBYClPWVnMoRKn5cdY4=";
        ll.Vendor = "PrimeSense";
        context.AddLicense(ll);

        this.Depth = openNode(NodeType.Depth) as DepthGenerator;
        this.mirror = this.Depth.MirrorCapability;
        if (oniFile == "") {
            this.Mirror = true;
        }
    }
开发者ID:corybarr,项目名称:PlanetariumSwarm,代码行数:25,代码来源:OpenNIContext.cs

示例2: xnInitialize

        // 初期化
        private void xnInitialize()
        {
            // コンテキストの初期化
              context = new Context();
              // OpenFileRecordingExを使うように促されるが、使用するとアクセスバイオレーションになる
              context.OpenFileRecording(RECORD_PATH);

              // プレーヤーの作成
              player = context.FindExistingNode(NodeType.Player) as OpenNI.Player;
              if (player == null) {
            throw new Exception(context.GlobalErrorState);
              }

              // 終端に達したら通知するコールバックを登録する
              player.EndOfFileReached += new EventHandler(player_EndOfFileReached);

              // イメージジェネレータの作成
              image = context.FindExistingNode(NodeType.Image) as ImageGenerator;
              if (image == null) {
            throw new Exception(context.GlobalErrorState);
              }

              // デプスジェネレータの作成
              depth = context.FindExistingNode(NodeType.Depth) as DepthGenerator;
              if (depth == null) {
            throw new Exception(context.GlobalErrorState);
              }

              // ヒストグラムバッファの作成
              histogram = new int[depth.DeviceMaxDepth];
        }
开发者ID:ninuxsoft,项目名称:KinectSensorProgramming,代码行数:32,代码来源:Form1_Player.cs

示例3: OpenNIRecordingController

        /// <summary>
        /// Creates a new control instance with a recording as data
        /// source. The current image data can be obtained by the
        /// <see cref="Image"/>-property. The
        /// <see cref="NewImageDataAvailable"/> event informs about when the
        /// data is updated, the <see cref="ErrorOccured"/>-event about
        /// errors.
        /// </summary>
        /// <exception cref="System.Exception">Thrown if the stream could not
        /// be initialized properly.</exception>
        public OpenNIRecordingController(String recording_filename,
            String movementDataFileName, String userAnnotationFilename)
        {
            // Create a new context and the data-generating nodes.
            context = new Context();
            context.OpenFileRecording(recording_filename);
            this.recording_filename = recording_filename;

            _userInformationReader = new BinaryReader(
                       new FileStream(movementDataFileName, FileMode.Open));

            using (FileStream annotation_stream = File.OpenRead(userAnnotationFilename))
            {
                _userLocationInformation = (ImageDictionary)movementDataSerializer.Deserialize(annotation_stream);
            }

            // Image
            imageGenerator = (ImageGenerator)context.FindExistingNode(NodeType.Image);

            // Depth
            depthGenerator = (DepthGenerator)context.FindExistingNode(NodeType.Depth);
            histogram = new int[depthGenerator.DeviceMaxDepth];

            // Player
            player = (Player)context.FindExistingNode(NodeType.Player);
            player.PlaybackSpeed = 1.0;

            if (depthGenerator == null || imageGenerator == null || player == null)
            {
                throw new Exception("Could not initialize recording stream.");
            }

            // Error handling
            context.ErrorStateChanged += context_ErrorStateChanged;
            context.StartGeneratingAll();
        }
开发者ID:jmtree,项目名称:Kinect-Annotation-and-Evaluation-Tool,代码行数:46,代码来源:OpenNIRecordingController.cs


注:本文中的OpenNI.Context.OpenFileRecording方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。