ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: lockhrt999 on August 15, 2020, 05:55:25 AM

Title: Get depth map out of Xiaomi MIUI camera photos.
Post by: lockhrt999 on August 15, 2020, 05:55:25 AM
What would be the command to export depth map out of photos captured by Xiaomi phones MIUI camera app. I think these are using different convention than what google camera does.

I tried this but it creates blank file only.
exiftool -b -DepthMap file.jpg > export.jpg

Attaching a sample file here.
Title: Re: Get depth map out of Xiaomi MIUI camera photos.
Post by: Phil Harvey on August 15, 2020, 06:35:09 AM
I can see the depth map data, but it will take a bit of work to figure out how to make sense of it.  It is definitely uncompressed, but has a large header of some sort.  You can dump the whole thing with this command:

exiftool -trailer -b FILE | exiftool -trailer -b - > depthmap.dat

- Phil
Title: Re: Get depth map out of Xiaomi MIUI camera photos.
Post by: Darshan on December 26, 2020, 06:29:53 AM
Hello.
I managed to parse most of the depthmap for my Redmi Note 9 Pro and i was looking for more samples from different models.

You can check the current code for my extractor here

https://github.com/VincenzoLaSpesa/XiaomiDepthMapExtractor

And you can send me samples if you want.

I also wanted to thank you as this exact thread was my starting point.
Title: Re: Get depth map out of Xiaomi MIUI camera photos.
Post by: Alan Clifford on December 26, 2020, 02:08:12 PM
Quote from: Darshan on December 26, 2020, 06:29:53 AM
Hello.
I managed to parse most of the depthmap for my Redmi Note 9 Pro and i was looking for more samples from different models.


I've got a Xiaomi mi a2 lite if you would like a photo from that.
Title: Re: Get depth map out of Xiaomi MIUI camera photos.
Post by: Phil Harvey on December 26, 2020, 08:33:43 PM
Sure.  If you can attach it here that would be good.  Otherwise upload it somewhere for whoever wants it.

- Phil
Title: Re: Get depth map out of Xiaomi MIUI camera photos.
Post by: Alan Clifford on December 27, 2020, 09:15:11 AM
Xiaomi m1 a2 lite photo attached.

Sadly the bird died after flying into a window.
Title: Re: Get depth map out of Xiaomi MIUI camera photos.
Post by: Phil Harvey on December 27, 2020, 09:21:01 AM
Thanks!
Title: Re: Get depth map out of Xiaomi MIUI camera photos.
Post by: Darshan on December 27, 2020, 06:34:12 PM
Thanks for the file.
But as far as I can tell there is no depthmap inside.
My phone creates a depthmap only in potrait mode, and if an image has it inside you see the tiny "diaphragm" icon when you open it.

This is the "foliage" image posted above and its depthmap converted to a png.
Title: Re: Get depth map out of Xiaomi MIUI camera photos.
Post by: Alan Clifford on December 28, 2020, 11:42:46 AM
So I click on portrait in the camera app and it says "Depth effect"

Title: Re: Get depth map out of Xiaomi MIUI camera photos.
Post by: Phil Harvey on January 05, 2021, 10:50:24 AM
Alan, I think that something has stripped off the depth-map trailer in the images you posted.  There is no depth map in either one.

- Phil
Title: Re: Get depth map out of Xiaomi MIUI camera photos.
Post by: defrag1971 on August 09, 2021, 07:19:21 PM
Hello,
any news about depth map extraction ?
I've got a Xiaomi Redmi 9t, same problem as stated from the others, the depth map is there but unreadable.
Herewith I attach one example from my phone.
Title: Re: Get depth map out of Xiaomi MIUI camera photos.
Post by: Phil Harvey on August 10, 2021, 06:45:36 AM
I can see some unknown data at the end of this file, but I don't know how to decode it.  You can extract a second image from the file like this:

exiftool Portrait.jpg -trailer -b > image2.jpg

Then you can get the trailer (presumably containing depth map data) like this:

exiftool image2.jpg -trailer -b > unknown.dat

- Phil
Title: Re: Get depth map out of Xiaomi MIUI camera photos.
Post by: defrag1971 on August 18, 2021, 09:01:10 AM
I found an app which does the trick:
Post3D

Bye