steren / stereo-img

web component to display stereographic pictures on web pages, with VR support
https://stereo-img.steren.fr
Apache License 2.0
22 stars 6 forks source link

Add support for pictures with depth map included #22

Open steren opened 7 months ago

steren commented 6 months ago

https://threejs.org/examples/webxr_vr_panorama_depth.html

steren commented 4 months ago

Google Camera portrait mode is supposed to have a depth map

steren commented 4 months ago

https://www.photopea.com/ is an online tool to view embedded depth map

steren commented 4 months ago

Spec for Google Camera: https://developer.android.com/static/media/camera/camera2/Dynamic-depth-v1.0.pdf

steren commented 4 months ago

image

steren commented 4 months ago

exiftool implementation

steren commented 4 months ago

exifr has an example for GDepth: https://mutiny.cz/exifr/examples/depth-map-extraction.html

steren commented 4 months ago

There are many standards:

steren commented 4 months ago

Let's keep going for For Dynamic Depth:

From https://stackoverflow.com/questions/58957619/android-q-get-depth-map-from-portrait-mode-photos:

Pixel phone portrait mode photo is concatenated of 4 JFIF structure https://en.wikipedia.org/wiki/JPEG_File_Interchange_Format. Each JFIF structure is an jpeg image. A JFIF structure starts with marker 0xFFD8 and ends with marker 0xFFD9. Therefore, we can split a portrait mode image into 4 jpeg files.

The Container.Directory exif has:

[
    {
        "parseType": "Resource",
        "Item": {
            "Mime": "image/jpeg",
            "Length": 0,
            "Semantic": "Primary"
        }
    },
    {
        "parseType": "Resource",
        "Item": {
            "Mime": "image/jpeg",
            "Length": 7850,
            "Semantic": "GainMap"
        }
    },
    {
        "parseType": "Resource",
        "Item": {
            "Mime": "image/jpeg",
            "Length": 1138762,
            "Semantic": "Original"
        }
    },
    {
        "parseType": "Resource",
        "Item": {
            "Mime": "image/jpeg",
            "Length": 181100,
            "Semantic": "Depth"
        }
    },
    {
        "parseType": "Resource",
        "Item": {
            "Mime": "image/jpeg",
            "Length": 65558,
            "Semantic": "Confidence"
        }
    }
]