10

There are many dual camera Android phones in the market which can take image with bokeh effect. Is it possible to create an Android app to make use of dual camera and get the depth of each pixel in image? Or accessing two camera at the same time to produce stereo image?

Sam
  • 1,252
  • 5
  • 20
  • 43

3 Answers3

4

Android P will be supporting multicamera mode so that developers/users can access both physical cameras. Depth calculation from monochrome is not a problem because most algorithms use the stereo pictures after converting them to gtay scale. In current versions the difficulty is only getting access to both physical cameras. I am too waiting for this Android release.

This one is written in OpenCV python using grayscale image as input. https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_calib3d/py_depthmap/py_depthmap.html

  • See https://stackoverflow.com/questions/46421329/get-depth-from-dual-camera-android-smartphone/46424780?noredirect=1#comment91599000_46424780 – Alex Cohn Sep 14 '18 at 06:25
  • As of now I still cannot do anything relate to multicamera on my nokia 7 plus with android P device. Don't know that they just not support or it was a bug in android rom – Thaina Yu Oct 09 '18 at 13:34
3

In certain Xiaomi phones, I have tested in Poco F1, it is possible to access the second depth sensing camera.

By tapping on the Kernel version multiple times, we can get to phone testing. There, we can access the second rear camera. The zoom level seems to be around 2X in my model and surprisingly it is a colour sensor. No autofocus though, but the depth is set at infinity so the photos aren't very bad.

The only way to save the pic seems to be taking a screenshot, unfortunately.

Bgos
  • 31
  • 1
  • In the Redmi 10 I see a grayscale image when testing the depth camera and it says that the picture is automatically saved. Any idea how to see/access the depth map instead of the grayscale image? – Micka Aug 05 '22 at 13:05
2

The modern dual-camera devices don't allow user control the way they use the lenses. I explained the situation also in an answer to Capturing a photo from only one lens, in dual-camera phones?. These devices have different cameras, e.g. color and mono (in case of Huawei P9), so reconstruction of stereo image would be difficult if not impossible even if you somehow get control of the two sensors.

On the other hand, the HTC Evo 3D phone comes with SDK that lets you do exactly this: work with the stereo picture.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
  • 4
    Now the android api level 28 was launched for android P, does the SDK let us retrieve depth map image directly like HTC SDK ? – Thaina Yu Sep 14 '18 at 04:55
  • 2
    I have not seen a live device with these features yet. It was a bold move by Google to lay down the new API, but I don't expect adoption to be very fast. I doubt that existing devices will expose this, even if they choose to upgrade from Oreo to Pie. – Alex Cohn Sep 14 '18 at 06:24
  • 1
    On my POCO F1 I can use the cameras separately after Android P update – OverCoder Jan 12 '19 at 18:38
  • 1
    But how did they do the image processing in the first place? Didn't they have to build some sort of depth map? Is there no way to get a 2d array or point cloud of depth as detected by the camera? (by the way, I don't need the image of the camera. Just the depth map) – pete May 21 '19 at 01:28