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

          # HDR示例-HdrMerge

           

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

           

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

           

          >本示例基于C++ High Level API進行演示

           

          創(chuàng)建Pipeline,進行流配置

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


          <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>

                天天爱天天干天天操 | 黄色一级大片免费版 | 欧美日韩精品成人综合77777 | 日韩三级电影网站 | 性一乱一交一交一视频 | 日美韩一级片 | 天天躁日日躁狠狠躁欧美老牛 | 麻豆91精品人妻成人无码 | 亚洲w码欧洲s码kkk14 | 男女裸交无遮挡啪啪激情免费 |