Reading depth and normal image with Intel realsense camera as external USB camera using android.hardware.camera2

37 views Asked by At

We have been using an app for Android for a number of years with the android.hardware.camera2 implementation for internal and external USB cameras.

We also use an Intel Realsense camera where, in addition to the normal image (preview and face detection), we also want the corresponding depth image.

Is this possible with Camera2, because I'm stuck not being able to do concurreny capture sessions.

The depth image is from another camera, with id 101 and the normal image is via camera, with id 105.

I can open them both. And that seems to be going well. But as soon as I make this call, createCaptureSession, it all seems to crash.

Is it even possible with camera2. Or should I switch to the intel realsense SDK with Android wrapper? Which will take more work in our case.

Tried several options, with the Android developers reference. Best Regards, Chris

1

There are 1 answers

0
Eddy Talvala On

It sounds like you have a custom hardware device, or at the least, some kind of developer kit from somewhere?

The camera2 API has support for depth output, so there's no OS-level reason you shouldn't be able to read depth images from this camera.

But whether it actually works is going to be a function of the camera HAL and drivers on this device, since this is presumably not a certified Android device (one that passes all of Android's compliance tests).

Since I don't what exact configurations you're requesting from the cameras (resolutions, formats, and consumer endpoints),or what the hardware can actually do, it's hard to guess where the problem might be. Possible sources of problems include:

  1. The device doesn't support running both cameras at once
  2. You're requesting a format the depth camera doesn't support
  3. You're requesting a resolution the depth camera doesn't support
  4. The depth camera lies about what it supports

For #1 you should get an error when you open the camera, but if the HAL lies about that too, there may just be errors in the system log.

But without knowing what's in the logs, and the exact configuration you're trying to use, it's hard to know more; you probably need to talk to your device provider to sort out what should work.