Creating a 3D effect from a 2D image

≯℡__Kan透↙ 提交于 2019-12-18 18:46:10

问题


I have a random 2D image. I would like to be able to present the image in 3D. This doesn't have to be very detailed, even if the image were arbitrarily broken into layers like a pop-up cutout from a children's book.

The goal would be that a given image would look normal when directly viewed but that if a viewer were to move/tilt left, right, up, down there would be a 3d effect.

This is similar but not exactly the same as this question here: How to create 3D streoscopic images using MATLAB with image tool?

This is complete over-kill: http://make3d.cs.cornell.edu/

And this is probably on the right track: http://www.imagemagick.org/Usage/distorts/#perspective

My ideal implementation would be a automated PHP script with ImageMagick take is fed an image and spits out as a result either (in order of preference):

  1. Images representing each layer, from nearest to deepest (closer to the childs pop-up book layer analogy)
  2. 5 images representing the said views (direct, left, right, top, bottom)

Has this been done (either of the above ideal implementations), or does anyone know how to do all, or part, of this?


回答1:


As far as the first part of your question is concerned, it sounds like your ideal implementation is http://make3d.cs.cornell.edu/, except that:

  • you want it simpler (return images from a fixed set of angles as opposed to a walkthrough)
  • you want it with imagemagick and PHP

I think that last restriction is unrealistic because there's a fair amount of maths and computer vision behind this kind of problem. Imagemagick will help you with lower level-image processing tasks like affine transforms, but it doesn't really provide the required higher-level computer vision functionality like 3D image reconstruction.

So my advice would be to try and work around that restriction somehow. If you implement the approach using more suitable tools (like C++ and OpenCV, for example, or Matlab, as the Make3D guys did), then you can wrap that in a CGI application so your PHP scripts can access it. Cornell (the authors of Make3D) had a similar thing going a while back, but it looks like they're not doing it any more.

For the second part of your question, the theory behind what you want to do has been fairly well-researched. See here for a list of depth estimation papers. Here is what things look like in source.



来源:https://stackoverflow.com/questions/4846982/creating-a-3d-effect-from-a-2d-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!