Make3D Convert your image into 3d model

Compiling and Running Make3D on your own computer

source: http://make3d.cs.cornell.edu/code_linux.html

Make3d has the ability to infer depth from a single 2D image. For more information on how it works see Make3D.cs.cornell.edu.

The code is available under Creative Commons Attribution-Noncommercial 3.0 unported license.To use the code, you must agree to cite the papers number 1 (TPAMI), 3 (ICCV-3dRR), and 9 (NIPS) available here, and the url: http://make3d.cs.cornell.edu

What you need
1) A computer running a linux distro (Ubuntu is recommended, but we have been able to run it everywhere including RedHat and amazon clusters). Standard build tools (g++, gcc etc)

2) Matlab

3) Mex compiler to compile C++ bindings to MatLab
See: http://www.mathworks.com/support/tech-notes/1600/1605.html

Steps

Step 1) Download and untar the make3d files as follows (I assume everything is done in the home directory)

cd ~
mkdir make3d
cd make3d
mkdir params
mkdir scratch
wget http://ai.stanford.edu/~asaxena/reconstruction3d/Make3dSingleImageStanford_version0.1.tar.gz
tar -xvzf Make3dSingleImageStanford_version0.1.tar.gz
cd params
wget http://ai.stanford.edu/~asaxena/reconstruction3d/MakedLearnedParameters_v0.1.tar.gz
tar -xvzf  MakedLearnedParameters_v0.1.tar.gz
cd ..

Step 2) Set the default directories for loading/storing training data and scratch data
Since we don’t want to have to pass these as arguments every time we are just going to modify the “OneShot3dEfficient.m” file to store these as defaults.

Go to the make3d/LearningCode/Debug and open the file OneShot3dEfficient.m
You will see several lines like the following (around lines 72-87)

ScratchFolder = ['/afs/cs/group/reconstruction3d/scratch/IMStorage' ];
ParaFolder = '/afs/cs/group/reconstruction3d/scratch/Para/';

change them to:

ScratchFolder = ['~/make3d/scratch' ];
ParaFolder = '~/make3d/params/';

(i.e pointing to the two folders we made earlier)

Step 3) Generate the various mex needed:
cd to ~/make3d/LearningCode
run MatLab
in matlab type:

>> InitialPath(true)

This will generate all the .mex files needed for the program to run

Now you probably want to download a test image to the
~/make3d/LearningCode directory … do that then restart matlab

run:

>> InitialPath(false)
>> OneShot3dEfficient('yourimage.jpg','./')

You should see something like the following be outputted:

>> InitialPath(false)
>> OneShot3dEfficient('paris.jpg','./')
Starting with new optimization...
Default = 

         filename: {'_'}
       ParaFolder: '~/make3d/params/'
     OutPutFolder: './'
    ScratchFolder: '~/make3d/scratch'
             Flag: [1x1 struct]

0.027535 seconds.
Loading the image...               0.2733 seconds.
Creating Superpixels...           3.0314 seconds.
Creating Features and multiple segmentations... 32.9655 seconds.
Calculating superpixel-shape features...       33.6513 seconds.
Preparation for the Inference...             39.8886 seconds.
Starting Inference...
     : Building Matrices....            2.1074
     : In 1st level Optimization, using new solver.(1/1,1/1) Success with alfa=1192.3985 Success with alfa=1635.6242     35.722
     : Writing WRL.grid 0attach 0            In WRL, vertices=2567 triangles=4691
Finished Inference at:         79.5021 seconds.
Writing superpixels and image...  79.8306 seconds.
Done.        Total time taken = 79.832 seconds.
>>

Thats all there is to it! You now have a .WRL file containing the outputted 3d model

Viewing the 3D WRL

There are many viewers to see the .WRL file. For example, you can install Cortonaviewer and view in Chrome or Firefox browser.

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值