• <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++ 深度精度示例代碼-Depth Unit Control

      # 深度精度示例-DepthUnitControl

       

      功能描述:演示獲取深度精度操作,顯示深度圖像,輸出深度精度,并通過ESC_KEY鍵退出程序

       

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

       

      創(chuàng)建Pipeline及流配置,并通過Pipeline獲取設(shè)備

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

      // Get the device inside the pipeline
      auto device = pipe.getDevice()

       

      檢查獲取深度精度的方式

      bool changeDepthUnitFlag = false;
      // check the way to adjust depth unit
      if(device->isPropertySupported(OB_PROP_DEPTH_PRECISION_LEVEL_INT, OB_PERMISSION_READ_WRITE)) {
          // change depth unit by adjust the depth precision level
          changeDepthUnitFlag = changeDepthUnit(device);
      }
      else if(device->isPropertySupported(OB_PROP_DEPTH_UNIT_FLEXIBLE_ADJUSTMENT_FLOAT, OB_PERMISSION_READ_WRITE)) {
          // for some models (Such as G300 series), user can adjust the depth unit by adjusting the depth unit flexible adjustment property
          changeDepthUnitFlag = changeDepthUnitFlexible(device);
      }
      else {
          std::cout << "Current device not support adjust depth unit, use the default depth unit 1mm" << std::endl;
          changeDepthUnitFlag = true;
      }

       

      計(jì)算深度值

      // For Y16 format depth frame, print the distance of the center pixel every 30 frames
      if(depthFrame->index() % 30 == 0 && depthFrame->format() == OB_FORMAT_Y16) {
          // Convert depth values to 1mm precision
          auto rstImageData = convertDepthFrameUnitTo1mm(depthFrame);

          uint32_t  width          = depthFrame->width();
          uint32_t  height         = depthFrame->height();
          uint16_t  centerDistance = rstImageData.data()[width * height / 2 + width / 2];

          // Attention: if the distance is 0, it means that the depth camera cannot detect the object(may be out of detection range)
          std::cout << "The depth frame center value is " << centerDistance << " mm. " << std::endl;

       

      釋放資源,退出程序。

      pipe.stop();

       

      預(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>
        成人毛片18女人毛片免费看3D动漫 | 色播综合 | 91精品久久久久无码人妻 | 日韩精品小电影 | 国产卡一卡二视频 |