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

      相機應(yīng)用代碼開發(fā)基礎(chǔ)

      API 如何使用

      獲取第一個 Orbbec 設(shè)備

      ob::Context ctx;
      auto devList = ctx.queryDeviceList();
      auto dev = devList->getDevice(0);

      通過默認配置開啟數(shù)據(jù)流

      ob::Pipeline pipe;  // create pipe with default device
      pipe.start(nullptr);  // start with defualt configuratio

      開啟紅外數(shù)據(jù)流

      對于 TOF 或單目結(jié)構(gòu)體光設(shè)備:

      ob::Pipeline pipe;
      std::shared_ptr<ob::Config> config = std::make_shared<ob::Config>();
      auto irProfiles = pipe.getStreamProfileList(OB_SENSOR_IR);
      auto irProfile = irProfiles->getProfile(OB_PROFILE_DEFAULT);
      config->enableStream(irProfile);
      pipe.start(config);

       

      對于雙目結(jié)構(gòu)光設(shè)備:

      ob::Pipeline pipe;
      std::shared_ptr<ob::Config> config = std::make_shared<ob::Config>();

      auto irLeftProfiles = pipe.getStreamProfileList(OB_SENSOR_IR_LEFT);
      auto irLeftProfile = irLeftProfiles->getProfile(OB_PROFILE_DEFAULT);
      config->enableStream(irLeftProfile);

      auto irRightProfiles = pipe.getStreamProfileList(OB_SENSOR_IR_RIGHT);
      auto irRightProfile = irRightProfiles->getProfile(OB_PROFILE_DEFAULT);
      config->enableStream(irRightProfile);

      pipe.start(config);

      等待獲取一組數(shù)據(jù)幀

      ob::Pipeline pipe;
      pipe.start(nullptr);
      auto frameSet = pipe.waitForFrames(100);
      auto depthFrame = frameSet->depthFrame();

      在后臺子線程處理數(shù)據(jù)

      std::mutex frameQueueMtx;
      std::queue<std::shared_ptr<ob::Frame>> frameQueue;
      auto precessThread = std::thread([&](){
          std::shared_ptr<ob::Frame> depthFrame;
          while(true{
            {
              std::lock_guard<std::mutex> lk(frameQueueMtx);
              if(frameQueue.empty()){
                std::this_thread::sleep_for(std::chrono::milliseconds(10));
                continue;
              }
              depthFrame = frameQueue.front();
              frameQueue.pop();
            }
            auto depthFrameData = depthFrame->data();
            // do some thing to process depth frame data;
          }
      })


      ob::Pipeline pipe;
      pipe.start(nullptr);
      while(true){
        auto frameSet = pipe.waitForFrames(100);
        auto depthFrame = frameSet->depthFrame();

        if(depthFrame){
          std::lock_guard<std::mutex> lk(frameQueueMtx);
          frameQueue.push(depthFrame)
        }
      }

      獲取深度到 RGB 的外參


      ob::Pipeline pipe;
      auto depthProfiles = pipe.getStreamProfileList(OB_SENSOR_DEPTH);
      auto depthProfile = depthProfiles->getProfile(OB_PROFILE_DEFAULT);
      auto colorProfiles = pipe.getStreamProfileList(OB_SENSOR_DEPTH);
      auto colorProfile = depthProfiles->getProfile(OB_PROFILE_DEFAULT);

      auto extrinsics = depthProfile->getExtrinsicTo(colorProfile);

      獲取視頻流內(nèi)參

      通過 Pipeline 獲取:

      ob::Pipeline pipe;
      pipe.start(nullptr);
      // get camera intrinsic and extrinsic parameters form pipeline and set to point cloud filter
      auto cameraParam = pipeline.getCameraParam();

       

      通過 Frame/StreamProfile 獲取(僅支持 Gemini 300 series):

      ob::Pipeline pipe;
      pipe.start(nullptr);

      auto frameSet = pipe.waitForFrames(100);
      auto frame = frameSet->depthFrame();
      auto streamProfile = frame->getStreamProfile();
      auto videoStreamProfile = streamProfile->as<ob::VideoStreamProfile>();

      auto intrinsic = videoStreamProfile->getIntrinsic();

      獲取深度單位

      ob::Pipeline pipe;
      pipe.start(nullptr);

      auto frameSet = pipe.waitForFrames(100);
      auto depthFrame = frameSet->depthFrame();

      auto uint = depthFrame->getValueScale();

      控制激光

      ob::Pipeline pipe;
      auto dev = pipe->getDevice();

      // Laser control (for Gemini 300 series)
      dev->setIntProperty(OB_PROP_LASER_CONTROL_INT, 1); // 0: off, 1: on, 2: auto

      // Turn on/off laser (for other series)
      dev->setBoolProperty(OB_PROP_LASER_BOOL, true);

      // Laser energy level control
      dev->setIntProperty(OB_PROP_LASER_ENERGY_LEVEL_INT, 2);

       


      • <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>
        黄片视频α片 | 少妇人妻一级A毛片 | 永久免费 在线观看 | 美女视频黄a视频免费全程软件axs | 亚洲无码成人在线观看 |