android / android/camera-samples

DEPTH 16 format produces 0 values

Offen
#433 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Kotlin
Sterne
5.5k
Forks
2.4k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Is DEPTH16 in Camera2 API ready to use? or we are supposed to use ARCore for depth detection? My use case is not to render depth data/image continuously on screen, but to capture a JPEG image and it's depth when user tap on capture button in a shot.

I created a capture request of TEMPLATE_PREVIEW / TEMPLATE_STILL_PICTURES for target image reader of Image Format DEPTH16 as following.
```
imageReader = ImageReader.newInstance(
240, 180, ImageFormat.DEPTH16, IMAGE_BUFFER_SIZE)
```

```
val captureRequest = camera.createCaptureRequest(
CameraDevice.TEMPLATE_PREVIEW).apply {
addTarget(depthImageReader.surface)
}
```

captureRequest.set(CaptureRequest.JPEG_ORIENTATION, 0)
val fpsRange: Range = Range(15, 30)
captureRequest.set(CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, fpsRange)
session.capture(captureRequest.build(), null, null)

```
imageReader.setOnImageAvailableListener({ reader ->
val image = reader.acquireNextImage()

```
on this image , with session.capture, the depth samples are all 0. if I replace it with session.setRepeatingRequest(captureRequest.build(), null, null), the first frames are still all 0 values, after some movement, the later frames has a a lot of 0, 8192, and very large values such as 17524 (17m which is not correct?), along with some random range.

I've tested https://medium.com/swlh/working-with-the-3d-camera-on-the-samsung-s10-5g-4782336783c , however the first frames are 0 as well



Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie mit der Prüfung der Camera2 API-Dokumentation für ImageFormat.DEPTH16, ImageReader und Aufnahme-Requests. Reproduzieren Sie das Problem mit dem gezeigten 240×180-DEPTH16-Setup sowohl mit session.capture als auch mit setRepeatingRequest und bestimmen Sie anschließend, ob die Null- und außerhalb des gültigen Bereichs liegenden Samples auf nicht unterstütztes Geräteverhalten oder einen Anwendungsfehler hindeuten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
kotlin
Bereich
mobile-dev
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.