<blockquote id="76sxc"></blockquote>
<cite id="76sxc"><track id="76sxc"></track></cite>
<legend id="76sxc"></legend>

  • <blockquote id="76sxc"><p id="76sxc"></p></blockquote>
    <sub id="76sxc"><p id="76sxc"></p></sub>

          C 后處理示例代碼-Post Processing

          # 后處理示例-Post-Processing

           

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

           

          功能描述:演示使用后處理操作,顯示后處理后的圖像,并通過(guò)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


          <blockquote id="76sxc"></blockquote>
          <cite id="76sxc"><track id="76sxc"></track></cite>
          <legend id="76sxc"></legend>

        1. <blockquote id="76sxc"><p id="76sxc"></p></blockquote>
          <sub id="76sxc"><p id="76sxc"></p></sub>

                国产精品6| 免费美女网站 | 亚洲成人电影三区 | 超碰 天天干 天天摸 | 嗯~用力啊~嗯~c我~鑫 | 天天搞天天摸 | 男人天堂综合网 | 婷婷色六月天 | 操妞网| 婷婷五月天综合社区在线观看 |