Geospatial Depth 기능으로 범위 확대

Geospatial Depth 히어로

이제 ARCore Depth API에서 Geospatial Depth를 지원합니다. Geospatial Depth를 사용하면 Streetscape Geometry도 사용 설정된 경우 Depth API의 범위와 속도가 자동으로 증가합니다. VPS 적용 범위가 있고 Streetscape Geometry가 사용 설정된 위치에 있는 경우 Depth API의 출력 이미지에는 현재 위치로부터 65m 떨어진 지역에서 가져온 지형 및 건물 도형이 포함됩니다. 도형에서 가져온 이 깊이 데이터는 로컬 깊이 관측과 병합되고 사용자가 새 위치로 이동할 때 업데이트됩니다.

이제 ARCore Depth API 호출이 단일 심도 이미지로 병합된 Streetscape Geometry의 건물과 지형뿐만 아니라 카메라의 로컬 관찰 결과를 모두 제공합니다.

기기 호환성

Geospatial Depth는 Depth API를 지원하는 기기에서 사용할 수 있습니다. 이 기능에는 비행 시간 (ToF) 센서와 같이 지원되는 하드웨어 깊이 센서가 필요하지 않습니다. 그러나 Depth API는 기기에 있을 수 있는 지원되는 하드웨어 센서를 사용합니다.

성능 영향

Geospatial Depth는 세션 시작 시 일회성 소규모 계산을 도입하여 처음 다운로드되었을 때 거리 풍경 형태를 깊이 표현에 통합하지만, 그 외의 경우에는 깊이 계산 비용이 측정 가능하지 않게 증가하지 않습니다.

깊이 범위

Geospatial Depth를 사용하지 않으면 깊이 이미지의 일반적인 범위는 약 20~30m 정도 떨어져 있으며, 깊이 관찰의 밀도와 정확성은 이 범위를 넘어서는 수준으로 줄어듭니다. Geospatial Depth를 사용 설정하면 조밀하게 샘플링된 깊이 값이 초기에 조금이라도 이동하더라도 최대 65.535미터에 도달하는 것이 일반적입니다.

사용 사례

ARCore Depth API는 이미 지원되는 모든 기존 사용 사례에 사용할 수 있습니다. Geospatial Depth를 사용하면 VPS 지원 위치에서 얻은 깊이 이미지가 전보다 빠르게 장거리 깊이로 채워지므로 실외 환경에서 장거리 깊이를 타겟팅하는 사용 사례가 가능합니다. 사용 사례의 예시는 다음과 같습니다.

  • 가상 콘텐츠 및 기타 시각 효과의 건물 규모 오클루전
  • 실외 내비게이션
  • 거리 측정

제한사항

Geospatial Depth는 VPS 현지화 및 Streetscape Geometry를 지원하는 영역에서만 지원됩니다. 다른 영역에서는 ARCore Depth API가 Geospatial 값 없이 정상적으로 작동합니다.

기본 요건

계속 진행하기 전에 기본 AR 개념ARCore 세션 구성 방법을 이해해야 합니다.

Geospatial Depth 사용 설정

새 ARCore 세션에서 사용자 기기가 Depth 및 Geospatial API를 지원하는지 확인합니다. 처리 성능 제약으로 인해 일부 ARCore 호환 기기는 Depth API를 지원하지 않습니다.

리소스를 절약하기 위해 ARCore에서는 깊이가 기본적으로 사용 중지됩니다. 앱에서 Depth API를 사용하도록 깊이 모드를 사용 설정합니다. 또한 Geospatial Depth를 사용하려면 Geospatial 모드와 Streetscape Geometry를 사용 설정하세요.

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.
}

다음 단계