Extract Depth Maps from iPhone Portrait Mode Photos

Started by felixarch, March 28, 2023, 07:49:42 AM

Previous topic - Next topic

felixarch

Hi all,

I am currently toying around with depth images and photogrammetry and wanted to extract the depth maps from iPhone (LiDAR-)Photos shot in Portrait mode. I know that the command is something like this

exiftool -b -DepthImage IMG_20210420_155329.jpg > depth.jpg
or

exiftool -b -MPImage2 IMG_XXXX.jpg > IMG_XXXX_depth.jpg
but anytime I try these commands, they'll return a file with 0kb.

Is there anything I am doing wrong? Or did Apple change the way how depth data is stored?

Thanks for your help!

Phil Harvey

No idea.  Run ExifTool without any parameters to see what metadata exists in the file.  DepthImage and MPImage2 will appear in this output if they exist.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

felixarch

Thanks Phil, I did list all metadata with exiftool and found out that iPhone portrait mode images have up to 8 layers with various masks and the last layer is the Depth Map. So the depth maps are stored in MPImage8 for the front camera and MPImage3 for the rear camera.