IPhone人像模式(Portrait)中其实保存了图像的深度信息,与颜色信息一同保存在每一张IMG_XXXX.JPG中。
如何将深度信息从此图片中剥离出来呢?外网Extracting depth information from iPhone portrait mode photos提供了一种方法:
//
Here’s how to extract the depth map from iPhone portrait mode photos
First, install exiftool:
Then, in a terminal run this command (from inside the folder with your portrait mode photos)
exiftool -b -MPImage2 IMG_XXXX.jpg > IMG_XXXX_depth.jpg
to extract the depth map from the image(XXXX用相应图片序号代替).
//
在windows下,可以先将exiftool.exe文件与所有IMG_XXXX.jpg文件放入同一个文件夹,再在此文件夹下新建一个文件夹(如我建的.\B\),一个简单的bat文件就可以批量完成深度图的提取(当前文件夹下所有图片的深度信息都将被存放至.\B\文件夹下):
@echo off
for %%i in (*.JPG) do call exiftool.exe -b -MPImage2 %%i > .\B\depth_%%%i