• <rt id="2awkm"><noscript id="2awkm"></noscript></rt>
      <rt id="2awkm"><noscript id="2awkm"></noscript></rt>
    • <dfn id="2awkm"></dfn>
      <menu id="2awkm"><acronym id="2awkm"></acronym></menu>
      
      
      <rt id="2awkm"></rt><dfn id="2awkm"><code id="2awkm"></code></dfn>
    • <dd id="2awkm"><s id="2awkm"></s></dd>
      <tbody id="2awkm"></tbody>
    • <dfn id="2awkm"></dfn>
      <menu id="2awkm"><noscript id="2awkm"></noscript></menu>

      C 后處理示例代碼-Post Processing

      # 后處理示例-Post-Processing

       

      支持設(shè)備: Gemini 330系列相機(jī),例如:Gemini G335

       

      功能描述:演示使用后處理操作,顯示后處理后的圖像,并通過ESC_KEY鍵退出程序

       

      >本示例基于C High Level API進(jìn)行演示

       

      創(chuàng)建pipeline,進(jìn)行流配置

      // Create a pipeline to open the depth stream after connecting the device
      pipeline = ob_create_pipeline(&error);
      check_error(error);

      // Create config to configure the resolution, frame rate, and format of the depth stream
      ob_config *config = ob_create_config(&error);
      check_error(error);

      // Configure the depth stream
      ob_stream_profile      *depth_profile = NULL;
      ob_stream_profile_list *profiles      = ob_pipeline_get_stream_profile_list(pipeline, OB_SENSOR_DEPTH, &error);
      check_error(error);

      // Find the corresponding profile according to the specified format, first look for the y16 format
      depth_profile = ob_stream_profile_list_get_video_stream_profile(profiles, 640, OB_HEIGHT_ANY, OB_FORMAT_Y16, 30, &error);
      // If the specified format is not found, search for the default profile to open the stream
      if(error) {
          depth_profile = ob_stream_profile_list_get_profile(profiles, OB_PROFILE_DEFAULT, &error);
          ob_delete_error(error);
          error = nullptr;
      }

      // enable stream
      ob_config_enable_stream(config, depth_profile, &error);
      check_error(error);

       

      獲取傳感器

      // Get device
      ob_device *device = ob_pipeline_get_device(pipeline, &error);
      check_error(error);

      // Get depth sensor
      ob_sensor *depthSensor = ob_device_get_sensor(device, OB_SENSOR_DEPTH, &error);
      check_error(error)

       

      獲取后處理列表

      ob_filter_list *filterList = ob_sensor_get_recommended_filter_list(depthSensor, &error);
      check_error(error);

       

      后處理

      ob_frame *depth_frame = ob_frameset_depth_frame(frameset, &error);
      check_error(error);

      if(depth_frame != nullptr) {
          for(uint32_t i = 0; i < count; i++) {
              ob_frame * new_depth_frame = nullptr;
              ob_filter *obFilter = filters[i];
              bool enable = ob_filter_is_enable(obFilter, &error);
              check_error(error);
              if(enable) {
                  new_depth_frame = ob_filter_process(obFilter, depth_frame, &error);
                  check_error(error);

                  ob_delete_frame(depth_frame, &error);
                  check_error(error);

                  depth_frame = new_depth_frame;
              }
          }
      }

       

      釋放相關(guān)資源

      for(uint32_t i = 0; i < count; i++) {
          ob_filter *obFilter = filters[i];
          ob_delete_filter(obFilter, &error);
          check_error(error);
      }

      // destroy profile filterList
      ob_delete_filter_list(filterList, &error);
      check_error(error);

      // stop the pipeline
      ob_pipeline_stop(pipeline, &error);
      check_error(error);

      // destroy the window
      delete win;

      // destroy profile
      ob_delete_stream_profile(depth_profile, &error);
      check_error(error);

      // destroy profile list
      ob_delete_stream_profile_list(profiles, &error);
      check_error(error);

      // destroy the pipeline
      ob_delete_pipeline(pipeline, &error);
      check_error(error);

      預(yù)期輸出:

       image.png


      • <rt id="2awkm"><noscript id="2awkm"></noscript></rt>
        <rt id="2awkm"><noscript id="2awkm"></noscript></rt>
      • <dfn id="2awkm"></dfn>
        <menu id="2awkm"><acronym id="2awkm"></acronym></menu>
        
        
        <rt id="2awkm"></rt><dfn id="2awkm"><code id="2awkm"></code></dfn>
      • <dd id="2awkm"><s id="2awkm"></s></dd>
        <tbody id="2awkm"></tbody>
      • <dfn id="2awkm"></dfn>
        <menu id="2awkm"><noscript id="2awkm"></noscript></menu>
        www.大香蕉日日撸 | 成人黄色免费观看 | 欧美一级黄片在线播放 | 男女无遮挡120动态图有限公司 | 欧美成人电影一区二区 |