Showing posts with label depth map. Show all posts
Showing posts with label depth map. Show all posts

Wednesday, August 13, 2014

3D Scans of my dogs

Subject: Mulan
age: approx 4
Classification: cockerspaniel + mystery.. could be a labradoodle 
pictured here after a haircut.

click to load the 3d models.. 
and then drag to rotate.. 
scroll to zoom.





    Mulan 3d #3DST9
    by Chaitanya Krishnan
    on Sketchfab






Subject: Rumi
age: approx 5+
Classification: Irish Setter





    Rumi in front of the Aquarium
    by Chaitanya Krishnan
    on Sketchfab




To see how i created these models and how you can too(no 3d skills needed anymore..i just updated that page with an easier method).. check out http://chaitanyakrishnan.blogspot.in/2014/07/3d-models-from-displacement-map.html

Thursday, July 24, 2014

3d models from displacement map

UPDATE:
About 5hrs ago  showed me his project that does the model creation process in the browser itself! give it a try here - http://www.clicktorelease.com/code/depth-player/

It works in your phone browser itself, and is quite fast! 

Original post:
And heres my experiment with the extracted depth map from a lens blur picture taken with a nexus.. more info here - http://chaitanyakrishnan.blogspot.in/2014/07/so-nexus-captures-depth-maps-now.html

basically its really low-fi 3d scanning..

heres a tutorial on how to do this yourself..
(a slower method using 3d tools.. if your the hands on kind of person)



and heres the model created in that tutorial



    Globe 3d #3DST8
    by Chaitanya Krishnan
    on Sketchfab



and these are some other models i created

My dog Rumi

    Rumi in 3d
    on Sketchfab


An old sword hanging on a wall..


    on Sketchfab



A pile of concrete blocks


    on Sketchfab

 My dog Mulan


    Mulan 3d
    on Sketchfab






So The Nexus Captures Depth Maps Now

So a few days back after my phone got all its updates.. i discovered the "Blur" mode in the camera. This mode basically creates faux depth of field.. or soft focus. I happily started using it without actually realizing what it has been doing all this time.

My brain melted when i realised that something that used to take advanced 3d software like 3dsMax and Blender minutes.. even hours to render (few years back anyway) .. google's camera app does it in seconds.

First a brief introduction to Depth Maps or as me and most of the 3d modelling community refers to as Z-depth maps

"In 3D computer graphics a depth map is an image or image channel that contains information relating to the distance of the surfaces of scene objects from a viewpoint. The term is related to and may be analogous to depth bufferZ-bufferZ-buffering and Z-depth. 

The "Z" in these latter terms relates to a convention that the central axis of view of a camera is in the direction of the camera's Z axis, and not to the absolute Z axis of a scene." - wikipedia

here are some examples of Z depth maps i rendered for different projects




and heres a detailed video of how to use them to add depth to an image

Now back to the Nexus' camera app.. in blur mode you Frame your photo, move the camera (phone) in an upward tilt or motion, and the software captures depth information.. 

The depth information is stored in the original still itself.. meaning that blur effects can be applied and altered in post-processing.. at any time!

So heres a pic of my dog Rumi(scroll down for my other dog Mulan).. and below it the original sharp image and the depth map

Using a clever website called Depthy( http://depthy.stamina.pl  by Rafal Lindemann) that can run on your phone, you can load up your nexus blur images and it lets you see the depth map.. edit it.. re-apply it.. and then it also lets you convert the image into a parallax photo.. which can be saved as a gif or video.. like so

for a detailed tutorial on how to use depthy, visit this page 

here are the basics:
1) Use the nexus camera to take a picture in Blur mode

2) Go to depthy.stamina.pl on your phone(chrome works.. other modern browsers will too) and upload your image .. once uploaded it lets you touch and drag to see the range of parallax available

3) Use the tools to make adjustments

4) Under the share option, theres actually a few other features like ..
exporting a stereoscopic 3d image(red and blue glasses required)

as well as animated gifs, video etc.. Download whichever you like.. various file sizes will be provided.

5) additionally if you like you can go to the "Image Properties" tab and download the extracted depth map.. coz.. well its pretty interesting looking.



here are some other gifs i created today..




enjoy! 

UPDATE:

As suggested by a friend i decided to try and use the Depth Map to generate a model/mesh

heres the result.. 



    Rumi in 3d
    by Chaitanya Krishnan
    on Sketchfab


as you can see the depth map and the subject do not work.. a more bass relief or flat object might work better.. here are some better ones - http://chaitanyakrishnan.blogspot.in/2014/07/3d-models-from-displacement-map.html


UPDATE 2: This camera app is available to most kitkat devices now, here are its requirements

• Works on phones and tablets running Android 4.4+ KitKat
• Photo Sphere and Panorama require a gyro sensor (not available on Moto G)
• Photo Sphere, Panorama, and Lens Blur require at least 1 gigabyte of memory


the camera app can be installed from here
https://play.google.com/store/apps/details?id=com.google.android.GoogleCamera