• <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++ 配置深度工作模式示例代碼-Config Depth Work Mode

      # 深度工作模式示例-DepthWorkMode

       

      支持的設(shè)備: Gemini 330系列,Gemini 2系列相機(jī),Astra 2系列相機(jī)

       

      功能描述:演示轉(zhuǎn)換深度工作模式操作。

       

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

       

      創(chuàng)建Pipeline, 獲取設(shè)備

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

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

       

      檢查是否支持工作模式轉(zhuǎn)換

      // Check whether the camera depth working mode is supported, currently (December 5, 2022) only the Gemini2 binocular camera supports the depth working mode
      if(!device->isPropertySupported(OB_STRUCT_CURRENT_DEPTH_ALG_MODE, OB_PERMISSION_READ_WRITE)) {
          pressKeyExit("Current device not support depth work mode!");
          return -1;
      }

       

      獲取深度工作模式列表

      // Query the current camera depth mode
      auto curDepthMode = device->getCurrentDepthWorkMode();
      // Get the list of camera depth modes
      auto depthModeList = device->getDepthWorkModeList();
      std::cout << "depthModeList size: " << depthModeList->count() << std::endl;
      for(uint32_t i = 0; i < depthModeList->count(); i++) {
          std::cout << "depthModeList[" << i << "]: " << (*depthModeList)[i];
          if(strcmp(curDepthMode.name, (*depthModeList)[i].name) == 0) {
              std::cout << "  (Current WorkMode)";
          }

          std::cout << std::endl;
      }

       

      設(shè)置深度工作模式

      // Let the user choose a mode, then switch
      if(depthModeList->count() > 0) {
          uint32_t index = 0;
          std::cout << "Please input the index from above depthModeList, newIndex = ";
          std::cin >> index;
          if(index >= 0 && index < depthModeList->count()) {  // legitimacy check
              device->switchDepthWorkMode((*depthModeList)[index].name);

              // Check whether the mode changes after the display is switched
              curDepthMode = device->getCurrentDepthWorkMode();
              if(strcmp(curDepthMode.name, (*depthModeList)[index].name) == 0) {
                  std::cout << "Switch depth work mode success! currentDepthMode: " << curDepthMode << std::endl;
              }
              else {
                  std::cout << "Switch depth work mode failed!" << std::endl;
              }
          }
          else {
              std::cout << "switchDepthMode faild. invalid index: " << index << std::endl;
          }
      }

       

      預(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>
        在线三级片网站 | 亚洲人成电影一区二区在线 | 天天操天天日天天插 | 欧美大逼逼 | 午夜宅男网站 |