Giter VIP home page Giter VIP logo

android-lens-blur-depth-extractor's Introduction

LensBlurDepthExtractor.js

This library parses images created with the new Android camera app mode Lens Blur and extracts the depth map.

Extractor tool is here: https://clicktorelease.com/tools/lens-blur-depth-extractor

Demo is here: https://www.clicktorelease.com/code/depth-player/

Snapshot

How to use

Include the library:

<script src="LensBlurDepthExtractor.js" ></script>

Instantiate an object:

var d = new DepthReader();

Load from a file:

d.loadFile( 
    'table.jpg', 
    function( src ) { /* src is base64 png source */ }, 
    function( error ) { /* error is a string */ } 
);

Or, load directly from an array buffer

d.parseFile( 
    arrayBuffer, 
    function( src ) { /* src is base64 png source */ }, 
    function( error ) { /* error is a string */ } 
);

License

MIT licensed

Copyright (C) 2016 Jaume Sanchez Elias http://twitter.com/thespite

Table picture by https://twitter.com/blurspline

http://www.clicktorelease.com

android-lens-blur-depth-extractor's People

Contributors

bergie avatar spite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-lens-blur-depth-extractor's Issues

try on potrait mode

does it work on xiaomi phone on portrait mode ? i try the demo web, it says no depth data.

Demo site stopped working?

When I try to load an image, even the sample table.png, the error: "Cannot read property 'mime' of undefined " is thrown.

Google Pixel 4 images"produce "No depth data found" message

I'm trying to extract depth from Portrait mode images taken with a Pixel 4 (Android 10), but when uploading the images to the depth extractor, I get a no depth data found message. The metadata of the images suggest that the depth data is indeed encoded.

<Camera:DepthMap rdf:parseType="Resource"> <DepthMap:ItemSemantic>Depth</DepthMap:ItemSemantic> <DepthMap:Format>RangeInverse</DepthMap:Format> <DepthMap:Units>Diopters</DepthMap:Units> <DepthMap:Near>0.086360</DepthMap:Near> <DepthMap:Far>0.129485</DepthMap:Far> <DepthMap:DepthURI>android/depthmap</DepthMap:DepthURI> <DepthMap:MeasureType>OpticalAxis</DepthMap:MeasureType> <DepthMap:ConfidenceURI>android/confidencemap</DepthMap:ConfidenceURI> <DepthMap:FocalTableEntryCount>256</DepthMap:FocalTableEntryCount> <DepthMap:FocalTable>ed2wPQAAAACwGLE9AAAAAA9UsT0AAAAAlY+xPQAAAABCy7E9AAAAABgHsj0AAAAAGEOyPQAAAAA/f7I9AAAAAI67sj0AAAAACPiyPQAAAACpNLM9AAAAAHNxsz0AAAAAZ66zPQAAAACG67M9AAAAAMwotD0AAAAAPWa0PQAAAADZo7Q9AAAAAJ3htD0AAAAAjB+1PQAAAACmXbU9AAAAAOubtT0AAAAAWtq1PQAAAAD0GLY9AAAAALpXtj0AAAAAqpa2PQAAAADG1bY9AAAAAA4Vtz0AAAAAg1S3PQAAAAAilLc9AAAAAO7Ttz0AAAAA5hO4PQAAAAAMVLg9AAAAAF2UuD0AAAAA3NS4PQAAAACIFbk9AAAAAGFWuT0AAAAAaJe5PQAAAACc2Lk9AAAAAP8Zuj0AAAAAj1u6PQAAAABOnbo9AAAAADvfuj0AAAAAViG7PQAAAAChY7s9AAAAABqmuz0AAAAAw+i7PQAAAACcK7w9AAAAAKNuvD0AAAAA27G8PQAAAABD9bw9AAAAANs4vT0AAAAAo3y9PQAAAACcwL09AAAAAMYEvj0AAAAAIUm+PQAAAACtjb49AAAAAGrSvj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_BURST20191031015532163_COVER

Support for Seene variation of the same?

(was referred to this project by Sketchfab support team)

I've tried to import some of my Seene-app (iOS) export format, which Creators claim is same as Google Lens Blur format.
But failed.

Please quick-look is the format is totally broken = unsupportable.
Maybe there is something simple to be changed = fixed?

Attaching some examples.
img_4027
img_4026
img_4025

Texture when uploaded to Sketchfab

Jaume,
when uploading a test image that you've provided with player,
it uploads fine:
https://sketchfab.com/models/e3ec8a3c7c5d46a2b57c5ba27903cfee

But when I upload first of Seene-captured .jpe files from #3 , processed with
10/1/4 options
go Sketchfab I get this:
https://sketchfab.com/models/e1763615030240a49e15242f2f487460
for second this:
https://sketchfab.com/models/06d8be292bc1479699cd4baba8e07158

And there is no texture related options available on Sketchfab.

It feels like the texture didn't make it to Sketchfab.

Could you please see if that is easy to fix?
Seene does not put the optional original image into XMP, as I remember.
Maybe you're relying on that original image in XMP, and, finding none, not uploading any?
Seene has only one image, processed image, and they don't keep originals inside at all.
Maybe it's possible to use original image data, main .jpeg file content?

Caption to Sketchfab

Jaume,
this is extremely small detail, but who knows, maybe you'd be in the mood one rainy day....

There is a caption field somewhere inside there.
It's actually there two times, in IPTC and TIFF areas (God knows what are they, I'm just looking in MacOS Preview app, and it shows me fields are there).

Also in Exif extractor:

macMini:lib paf$ /Users/paf/Downloads/Image-ExifTool-10.24/exiftool  /Users/paf/Downloads/34d701b6-545a-11e6-9399-5e35c41058fe.JPG |grep -i mock
Image Description               : #Petya in a hat in a hammock. 5 degrees above freezing point.
Caption-Abstract                : #Petya in a hat in a hammock. 5 degrees above freezing point.
macMini:lib paf$ 

Please consider using some of that, if present, as a Sketchfab caption?
I'm not sure which of those is longer according to standards, and I'm not sure how long Sketcfab allows caption to be. Some of my captions are so long they don't fit.
There are also #hashtags inside that caption, see that "#Petya" part?
I'm not sure if those are possible to go to Sketchfab hashtags, but that would also be nice.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.