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

      獲取圖像數(shù)據(jù)

      本文內(nèi)容

      ● 配置并啟動(dòng)設(shè)備

      ● 穩(wěn)定

      ● 重Capture中獲取Image

      ● 獲取圖像數(shù)據(jù)

      ● 后續(xù)步驟

      本頁(yè)面詳細(xì)介紹了通過(guò)Femto Bolt獲取深度和彩色圖像數(shù)據(jù)的方法。 獲取圖像數(shù)據(jù)前,需要先打開(kāi)設(shè)備,并通過(guò)配置開(kāi)啟數(shù)據(jù)流,然后就可以獲取圖像數(shù)據(jù)。

      在配置和獲取圖像數(shù)據(jù)之前,必須查找并打開(kāi)設(shè)備

      你可以參考 streaming sample, 這個(gè)例子演示了如何使用本文中描述的函數(shù)

      本文將介紹以下函數(shù):

      ● k4a_device_start_cameras()

      ● k4a_device_get_capture()

      ● k4a_capture_get_depth_image()

      ● k4a_image_get_buffer()

      ● k4a_image_release()

      ● k4a_capture_release()

      ● k4a_device_stop_cameras()


      配置并啟動(dòng)設(shè)備

      Femto Bolt   深度相機(jī)和彩色相機(jī)支持多種模式、分辨率和輸出格式。 有關(guān)完整列表,請(qǐng)參考硬件規(guī)格

      流配置是通過(guò) k4a_device_configuration_t 數(shù)據(jù)結(jié)構(gòu)配置。

      k4a_device_configuration_t config = K4A_DEVICE_CONFIG_INIT_DISABLE_ALL;
      config.camera_fps = K4A_FRAMES_PER_SECOND_30;
      config.color_format = K4A_IMAGE_FORMAT_COLOR_MJPG;
      config.color_resolution = K4A_COLOR_RESOLUTION_2160P;
      config.depth_mode = K4A_DEPTH_MODE_NFOV_UNBINNED;
      if (K4A_RESULT_SUCCEEDED != k4a_device_start_cameras(device, &config))
      {
          printf("Failed to start device\n");
          goto Exit;
      }

      相機(jī)啟動(dòng)后便不斷捕獲數(shù)據(jù),直到調(diào)用k4a_device_stop_cameras()函數(shù)或設(shè)備Close。


      穩(wěn)定

      使用多設(shè)備同步功能時(shí),我們強(qiáng)烈建議使用固定的曝光設(shè)置。  如果使用自動(dòng)曝光,最多可能需要20 幀,圖像和幀速率才能穩(wěn)定。


      從Device中獲取Capture對(duì)象

      開(kāi)啟視頻流后,Capture用來(lái)獲取圖像數(shù)據(jù),每個(gè)Capture包含深度圖像、IR 圖像、彩色圖像或這些圖像的組合。

      默認(rèn)情況下,API 只會(huì)在收到流模式請(qǐng)求的所有圖像后才返回捕獲。 可以通過(guò)將 k4a_device_configuration_t 的 synchronized_images_only 參數(shù)配置為 false,從而將 API 配置為在深度圖像或彩色圖像可用后,立即返回僅包含這些圖像的部分捕獲。

      // Capture a depth frame
      k4a_capture_t capture = NULL;
      switch (k4a_device_get_capture(device, &capture, TIMEOUT_IN_MS))
      {
      case K4A_WAIT_RESULT_SUCCEEDED:
          break;
      case K4A_WAIT_RESULT_TIMEOUT:
          printf("Timed out waiting for a capture\n");
          continue;
          break;
      case K4A_WAIT_RESULT_FAILED:
          printf("Failed to read a capture\n");
          goto Exit;
      }

      在 API 成功返回Capture后,當(dāng)你用完Capture對(duì)象時(shí),必須調(diào)用 k4a_capture_release()


      從Capture中獲取Image

      若要獲取Capture中包含的圖像,請(qǐng)針對(duì)不同的圖像類型調(diào)用相應(yīng)的函數(shù)。

      ● k4a_capture_get_color_image()

      ● k4a_capture_get_depth_image()

      ● k4a_capture_get_ir_image()

      獲取完圖像數(shù)據(jù)后,需要調(diào)用k4a_image_release()釋放k4a_image_t句柄。


      獲取圖像數(shù)據(jù)

      k4a_image_t 提供了獲取圖像屬性的相應(yīng)函數(shù)。

      如要獲取圖像的內(nèi)存緩沖區(qū),請(qǐng)使用 k4a_image_get_buffer

      以下示例演示如何從Capture中獲取深度圖像,獲取IR和彩色圖像的方法類似。 必須將圖像類型變量替換為正確的圖像類型,例如 ir 或 color。

      // Access the depth16 image
      k4a_image_t image = k4a_capture_get_depth_image(capture);
      if (image != NULL)
      {
          printf(" | Depth16 res:%4dx%4d stride:%5d\n",
                  k4a_image_get_height_pixels(image),
                  k4a_image_get_width_pixels(image),
                  k4a_image_get_stride_bytes(image));
          // Release the image
          k4a_image_release(image);
      }
      // Release the capture
      k4a_capture_release(capture);


      后續(xù)步驟

      既然你已了解如何獲取彩色圖像和深度圖像,使用 Femto Bolt 設(shè)備。 你還可以:獲取IMU數(shù)據(jù) 和 圖像轉(zhuǎn)換

      • <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>
        中文字幕成人乱码熟女 | ⅹxxxxhd亚洲日本hd老师 | 三级经典在线 | 日韩人人干 | 另类国产 |