• <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,進(jìn)行流配置

      // Create a pipeline with default device
      ob::Pipeline pipe;

      // Configure which streams to enable or disable for the Pipeline by creating a Config
      std::shared_ptr<ob::Config> config = std::make_shared<ob::Config>();

      std::shared_ptr<ob::VideoStreamProfile> irProfile = nullptr;
      try {
          // Get all stream profiles of the ir camera, including stream resolution, frame rate, and frame format
          auto irProfiles = pipe.getStreamProfileList(OB_SENSOR_IR_LEFT);
          if(irProfiles) {
              irProfile = std::const_pointer_cast<ob::StreamProfile>(irProfiles->getProfile(OB_PROFILE_DEFAULT))->as<ob::VideoStreamProfile>();
          }
          config->enableStream(irProfile);
      }
      catch(...) {
          std::cerr << "Current device is not support ir sensor!" << std::endl;
          exit(EXIT_FAILURE);
      }

      // Get all stream profiles of the depth camera, including stream resolution, frame rate, and frame format
      auto                                    depthProfiles = pipe.getStreamProfileList(OB_SENSOR_DEPTH);
      std::shared_ptr<ob::VideoStreamProfile> depthProfile  = nullptr;
      if(depthProfiles) {
          depthProfile = std::const_pointer_cast<ob::StreamProfile>(depthProfiles->getProfile(OB_PROFILE_DEFAULT))->as<ob::VideoStreamProfile>();
      }
      config->enableStream(depthProfile);

       

      打開HDR處理

      // Create HdrMerage post processor
      ob::HdrMerge hdrMerge;

      // open hdr merage
      if(pipe.getDevice()->isPropertySupported(OB_STRUCT_DEPTH_HDR_CONFIG, OB_PERMISSION_READ_WRITE)) {
          // Get depth exposure value range,the exposure_1 and exposure_2 in OBHdrConfig can be adjusted.
          OBIntPropertyRange depthExpRange = pipe.getDevice()->getIntPropertyRange(OB_PROP_DEPTH_EXPOSURE_INT);
          // Get depth gain value range,,the gain_1 and gain_1 in OBHdrConfig can be adjusted.
          OBIntPropertyRange depthGainRange = pipe.getDevice()->getIntPropertyRange(OB_PROP_DEPTH_GAIN_INT);

          OBHdrConfig obHdrConfig;
          uint32_t    dataSize = sizeof(OBHdrConfig);
          pipe.getDevice()->getStructuredData(OB_STRUCT_DEPTH_HDR_CONFIG, &obHdrConfig, &dataSize);
          // open hdr
          obHdrConfig.enable = true;

          pipe.getDevice()->setStructuredData(OB_STRUCT_DEPTH_HDR_CONFIG, &obHdrConfig, sizeof(OBHdrConfig));
      }

       

      開啟pipeline

      pipe.start(config);

       

       

      獲取HDR處理后的圖像

      auto leftIRFrame = frameSet->getFrame(OB_FRAME_IR_LEFT);
      if(leftIRFrame) {
          framesForRender.push_back(leftIRFrame);
      }

      auto depthFrame = frameSet->depthFrame();
      if(depthFrame != nullptr) {
          auto newFrame = hdrMerge.process(frameSet);
          auto newFrameSet = newFrame->as<ob::FrameSet>();
          if(newFrameSet) {
              depthFrame = newFrameSet->depthFrame();
              if(depthFrame) {
                  framesForRender.push_back(depthFrame);
              }
          }
      }

       

      關(guān)閉pipeline

      pipe.stop();

       

      關(guān)閉Hdr處理

      if(pipe.getDevice()->isPropertySupported(OB_STRUCT_DEPTH_HDR_CONFIG, OB_PERMISSION_READ_WRITE)) {
          OBHdrConfig obHdrConfig;
          uint32_t    dataSize = sizeof(OBHdrConfig);
          pipe.getDevice()->getStructuredData(OB_STRUCT_DEPTH_HDR_CONFIG, &obHdrConfig, &dataSize);
          obHdrConfig.enable = false;
          pipe.getDevice()->setStructuredData(OB_STRUCT_DEPTH_HDR_CONFIG, &obHdrConfig, sizeof(OBHdrConfig));
      }

      ```

      預(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>
        偷窥美女洗澡网站 | 久久夜色精品国产噜噜亚洲AV高 | 人人操人人撸 | 午夜区二区三区不卡顿91 | 8x8x国产精品 |