从 2D 图像创建 3D 效果
我有一个随机的二维图像。我希望能够以 3D 形式呈现图像。这不必非常详细,即使图像被任意分成几层,就像儿童读物中的弹出剪贴画一样。
目标是给定图像在直接观看时看起来正常,但如果观看者向左、右、上、下移动/倾斜,就会出现 3D 效果。
这与这里的问题类似但不完全相同: 如何使用 MATLAB 和图像创建 3D 立体图像工具?
这完全是过度杀戮: http://make3d.cs.cornell.edu/
这可能是在正确的轨道上: 我
的理想的实现是使用 ImageMagick 的自动化 PHP 脚本,将图像输入并输出结果(按优先顺序):
- 代表每一层的图像,来自 最接近最深(接近 儿童弹出书层类比)
- 代表上述视图的 5 张图像 (直接、左、右、上、下)
是否已完成(上述理想实现之一),或者有人知道如何完成全部或部分操作吗?
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):
- Images representing each layer, from
nearest to deepest (closer to the
childs pop-up book layer analogy) - 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就您问题的第一部分而言,听起来您的理想实现是 http://make3d.cs.cornell.edu/,除了:
我认为最后这种限制是不现实的,因为这类问题背后有大量的数学和计算机视觉。 Imagemagick 将帮助您完成仿射变换等较低级别的图像处理任务,但它并不能真正提供所需的更高级别的计算机视觉功能,例如 3D 图像重建。
所以我的建议是尝试以某种方式解决这个限制。如果您使用更合适的工具(例如 C++ 和 OpenCV,或者像 Make3D 人员那样使用 Matlab)来实现该方法,那么您可以将其包装在 CGI 应用程序中,以便您的 PHP 脚本可以访问它。康奈尔大学(Make3D 的作者)不久前也做过类似的事情,但看起来他们不再这样做了。
对于你问题的第二部分,你想要做的事情背后的理论已经得到了相当充分的研究。请参阅此处获取深度估计论文列表。 这里是源代码中的内容。
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:
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.