Jul 11, 2007

Converting 2D images to 3D

As I was working today i came across a really nifty tool for doing automatic 3D-mapping of standard images.

The project is found here
http://www.cs.cmu.edu/~dhoiem/projects/popup/

As i started playing around i found that a whole lot of more tools are needed to create the models, then i came across this blog, by a guy that did the whole thing about a year ago.
Apparently he was using Linux, because one of the tools wasn't available as a win32 executable.
http://blog.duk0r.net/2006/09/30/
how-to-transform-2d-images-to-3d/



(After step 3 your image should look like the right one)

Heres the whole thing again, but in win32 only:

Software

ImageMagick (Convert input image to .pnm) [Binary]
Image Segmentation [Source] [Binary] (This binary is compiled by me, and i give no support whatsoever)
Automatic Photo Pop-up [Binary][Documentation]
MATLAB 7.x libraries (100 MB) [Binary] (If MATLAB isn't installed on your computer, you must install the runtime libraries)

How-to


  • Make sure to install everything correctly, ImageMagick and the other tools are best added to path so you can access them directly from the command prompt, because you'll spend the time there from here on.
  • use ImageMagick
    example command: convert image.jpg image.pnm
  • then use Image Segmentation
    usage: ./segment sigma k min input(ppm) output(ppm)

    example command: segment 0.8 100 100 image.pnm image.pnm
  • after that, use Photo Pop-up
    usage: photoPopup [fnData] [fnImage] [extSuperpixelImage] [outdir]
    fnData: filename for .mat file containing classifier data
    fnImage: filename for original RGB image
    extSuperpixelImage: filename extension for superpixel image
    outdir: directory to output results

    (make sure you have your images in the right directories)
    example command: photoPopup ./classifiers_08_22_2005 ./image.jpg pnm ./output
    (this step took 5-10 minutes)
  • Find a fitting wrl-viewer/converter to view/convert the results.
Footnote

Read all the documentation thouroughly, if you like science find out more about how the image segmentation works here. Or more about Geometrically Coherent Image Interpretation here.

1 comment:

liscunha said...

hello! you posted here about a small town called Schweina... i'm moving there in September, what can you tell me about it? can we exchange e-mails? my e-mail is lisparizzi@gmail.com

thanks in any case!