Note 8 Live focus Image

Started by tonE, March 15, 2018, 07:10:55 PM

Previous topic - Next topic

Phil Harvey

exiftool -DepthMapTiff -b -W %f_depth%.nc.tif FILE
...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 ($).

FMax


FMax

New Samsung Galaxy smartphones have slightly different approaches.

Galaxy S10+ doesn't store depth map at all, but stores both photographs: from regular and wide-angle lens cameras.

And Galaxy A80 stores both photographs (from regular and wide-angle lens cameras) as well as depth map. The depth map is stored under a new tag, which falls into unknown category, so it can be extracted with the following command:
exiftool -SamsungTrailer_0x0ab1 -U -b -W %f_depth%.nc.pgm FILE
Then open this file in Notepad++ (or any similar editor) and add (just in plain ASCII) the following 3 lines in the beginning of the file:
P5
1060 795
255

P5 specifies the file to be in Binary Portable GrayMap format (https://en.wikipedia.org/wiki/Netpbm_format#File_format_description).
1060 795 are depth map width and height, respectively.
255 is the maximum gray value.
Quote from: FMax on November 17, 2018, 09:33:44 AM
Note that depth maps exported this way are in its original orientation and are not affected by metadata Orientation tag.
To view PGM files and rotate them you can use XnView, for example.

Tag name (-SamsungTrailer_0x0ab1) can be found this way:
exiftool -args -U FILE

And depth map width and height (1060 and 795) can likely be found in DualShot_Meta_Info or DualShot_Extra_Info, or calculated:
x = ⌊√(s/(ab))⌋, where s is PGM file size (843760 in case of Galaxy A80), a is aspect ratio width units (4 in case of A80), b is aspect ratio width units (3 in case of A80).
w = ax
h = bx

Phil Harvey

Quote from: FMax on July 01, 2019, 12:38:14 PM
And Galaxy A80 stores both photographs (from regular and wide-angle lens cameras) as well as depth map. The depth map is stored under a new tag[...]

Could you possibly send me a pair of these files (philharvey66 at gmail.com).

- 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 ($).

FMax


Phil Harvey

Thanks, but I meant to send a live-focus pair.  Not two different images.

- 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 ($).

FMax

By live-focus pair do you mean two photographs from regular and wide-angle lens cameras? Those are stored inside of each JPEG file I've sent you: 2 images extractable with -embeddedimage tag.

Phil Harvey

Ah, OK.  I misunderstood.  Thanks.

I have patched the most recent version of ExifTool to extract the DepthMapWidth/Height from these files.

- 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 ($).

FMax

That's fast :) Works great. Thank you!

FMax

A note about extracting depth maps from Nokia 9 PureView. This can be done with the following command:
exiftool -DepthImage -b -W %f_depth%.nc.jpg FILE