Geospatial Depth(地理空間の深度)を使用して範囲を拡大する

Geospatial Depth ヒーロー

ARCore Depth API で Geospatial Depth がサポートされるようになりました。これにより、Streetscape Geometry も有効になっている場合に、自動的に範囲と速度が広がります。VPS カバレッジと Streetscape Geometry が有効になっているロケーションでは、Depth API からの出力画像には、現在の位置から 65 m 以内のエリアで取得された地形と建物のジオメトリが含まれます。ジオメトリから取得したこの奥行きデータは、ローカルの奥行き観測データと統合され、ユーザーが新しい場所に移動すると更新されます。

<ph type="x-smartling-placeholder"> <ph type="x-smartling-placeholder">

ARCore Depth API 呼び出しで、カメラからの局所的な観測と、Streetscape Geometry からの建物と地形の両方を、単一の深度画像に結合できるようになりました。

デバイスの互換性

Geospatial Depth は、Depth API をサポートするすべてのデバイスで利用できます。この機能に、飛行時間(ToF)センサーなど、サポートされているハードウェア奥行きセンサーは必要ありません。ただし、Depth API は、デバイスでサポートされているハードウェア センサーを使用します。

パフォーマンスへの影響

Geospatial Depth は、セッションの開始時に 1 回限りの小さな計算を導入し、Streetscape Geometry を最初のダウンロード時に深度表現に統合しますが、それ以外の場合、深度の計算コストは明らかに増加しません。

奥行きの範囲

Geospatial Depth がなければ、奥行き画像の一般的な範囲は 20 ~ 30 m ほど離れ、その範囲を超えると深度観測の密度と精度が低下します。Geospatial Depth を有効にすると、初期の動きがわずかでも、密にサンプリングされた深度値が最大 65.535 m に達することがよくあります。

<ph type="x-smartling-placeholder">

ユースケース

ARCore Depth API は、すでにサポートされているすべての既存のユースケースに使用できます。Geospatial Depth は、VPS でサポートされている場所で取得された奥行き画像に、これまでよりも迅速に長距離の深度が取り込まれるため、屋外環境で長距離の深度をターゲットとするユースケースが可能になります。ユースケースには、次のようなものがあります。

  • 仮想コンテンツとその他の視覚効果の建物規模のオクルージョン
  • 屋外ナビゲーション
  • 距離の計測

制限事項

Geospatial Depth は、VPS のローカライズと Streetscape Geometry をサポートしているエリアでのみサポートされます。その他の地域では、地理空間値がなくても ARCore Depth API は通常どおり動作します。

前提条件

AR の基礎的なコンセプトを理解しておいてください。 と ARCore セッションを構成する方法を確認してください。

Geospatial Depth を有効にする

新しい ARCore セッションで、次の操作を行います。 ユーザーのデバイスが Depth と Geospatial API をサポートしているかどうかを確認する 処理能力の制約により、ARCore 対応デバイスはすべて Depth API をサポートしているわけではありません。

リソースを節約するため、ARCore では深度がデフォルトで無効になっています。 アプリで Depth API を使用するには、深度モードを有効にします。 さらに、地理空間モードとストリートビュー ジオメトリを有効にして、 Geospatial Depth(地理空間の深度)を使用します。

Java

Config config = session.getConfig();

// Check whether the user's device supports the Depth API.
boolean isDepthSupported = session.isDepthModeSupported(Config.DepthMode.AUTOMATIC);
boolean isGeospatialSupported =
    session.isGeospatialModeSupported(Config.GeospatialMode.ENABLED);
if (isDepthSupported && isGeospatialSupported) {
  // These three settings are needed to use Geospatial Depth.
  config.setDepthMode(Config.DepthMode.AUTOMATIC);
  config.setGeospatialMode(Config.GeospatialMode.ENABLED);
  config.setStreetscapeGeometryMode(Config.StreetscapeGeometryMode.ENABLED);
}
session.configure(config);

Kotlin

val config = session.config

// Check whether the user's device supports the Depth API.
val isDepthSupported = session.isDepthModeSupported(Config.DepthMode.AUTOMATIC)
val isGeospatialSupported = session.isGeospatialModeSupported(Config.GeospatialMode.ENABLED)
if (isDepthSupported && isGeospatialSupported) {
  // These three settings are needed to use Geospatial Depth.
  config.depthMode = Config.DepthMode.AUTOMATIC
  config.geospatialMode = Config.GeospatialMode.ENABLED
  config.streetscapeGeometryMode = Config.StreetscapeGeometryMode.ENABLED
}
session.configure(config)

Geospatial Depth を有効にすると、Depth デベロッパー ガイドで説明されているように、既存の API 呼び出しから奥行き画像にアクセスできます。

Java

// Retrieve the depth image for the current frame, if available.
Image depthImage = null;
try {
  depthImage = frame.acquireDepthImage16Bits();
  // Use the depth image here.
} catch (NotYetAvailableException e) {
  // This means that depth data is not available yet.
  // Depth data will not be available if there are no tracked
  // feature points. This can happen when there is no motion, or when the
  // camera loses its ability to track objects in the surrounding
  // environment.
} finally {
  if (depthImage != null) {
    depthImage.close();
  }
}

Kotlin

// Retrieve the depth image for the current frame, if available.
try {
  frame.acquireDepthImage16Bits().use { depthImage ->
    // Use the depth image here.
  }
} catch (e: NotYetAvailableException) {
  // This means that depth data is not available yet.
  // Depth data will not be available if there are no tracked
  // feature points. This can happen when there is no motion, or when the
  // camera loses its ability to track objects in the surrounding
  // environment.
}

次のステップ