• <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 深度HDR示例代碼-Hdr Merge

      # HDR示例-HdrMerge

       

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

       

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

       

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

       

      創(chuàng)建pipeline,配置depth和ir流

      // 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);

      // Configure the infrared stream
      // Please adjust the sensor according to the actual product, some device types only have OB_SENSOR_IR_LEFT and OB_SENSOR_IR_RIGHT.
      ob_stream_profile *     ir_profile = NULL;
      ob_stream_profile_list *ir_profiles   = ob_pipeline_get_stream_profile_list(pipeline, OB_SENSOR_IR_LEFT, &error);
      check_error(error);

      if(profiles == nullptr) {
          printf(
              "The obtained IR resolution list is NULL. For binocular structured light devices, try using the doubleIr example to turn on the ir data stream. ");
          return 0;
      }

      // Find the corresponding profile according to the specified format, first look for the y16 format
      ir_profile = ob_stream_profile_list_get_video_stream_profile(ir_profiles, 640, OB_HEIGHT_ANY, OB_FORMAT_Y8, 30, &error);
      // If the specified format is not found, search for the default profile to open the stream
      if(error) {
          ir_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, ir_profile, &error);
      check_error(error);

       

      獲取device

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

       

      打開HDR處理

      // Create HdrMerage post processor
      ob_filter *hdr_merge_filter = ob_create_hdr_merge(&error);
      check_error(error);

      bool is_supported = ob_device_is_property_supported(dev, OB_STRUCT_DEPTH_HDR_CONFIG, OB_PERMISSION_READ_WRITE, &error);
      check_error(error);
      // open hdr merage
      if(is_supported) {
          // Get depth exposure value range,the exposure_1 and exposure_2 in OBHdrConfig can be adjusted.
          ob_int_property_range depth_exp_range = ob_device_get_int_property_range(dev, OB_PROP_DEPTH_EXPOSURE_INT, &error);
          check_error(error);

          // Get depth gain value range,,the gain_1 and gain_1 in OBHdrConfig can be adjusted.
          ob_int_property_range depth_gain_range = ob_device_get_int_property_range(dev, OB_PROP_DEPTH_GAIN_INT, &error);
          check_error(error);

          ob_hdr_config hdr_config;
          uint32_t      dataSize = sizeof(ob_hdr_config);
          ob_device_get_structured_data(dev, OB_STRUCT_DEPTH_HDR_CONFIG, &hdr_config, &dataSize, &error);
          check_error(error);
          // open hdr
          hdr_config.enable = true;

          ob_device_set_structured_data(dev, OB_STRUCT_DEPTH_HDR_CONFIG, &hdr_config, dataSize, & error);
          check_error(error);
      }

       

      開啟pipeline

      ob_pipeline_start_with_config(pipeline, config, &error);

       

      獲取HDR處理后的圖像

      auto new_frame_set = ob_filter_process(hdr_merge_filter, frameset, &error);
      check_error(error);

      auto new_depth_frame = ob_frameset_depth_frame(new_frame_set, &error);
      check_error(error);
      if(new_depth_frame != nullptr) {
          frames.push_back(new_depth_frame);
      }

       

      停止pipeline

      ob_pipeline_stop(pipeline, &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>
        全免费看全黄裸体 | 欧美一卡二卡在线观看 | 高清无码在线观看免费 | 艳妇殿荡乳欲伦交换 | 男女成人 免费视频在线观看 |