照片的头像生成 [英] avatar generation from photograph

查看:54
本文介绍了照片的头像生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.这个问题很简单明了,有没有人知道如何编写代码,以根据用户提供的2d照片生成3d照片逼真的头像(就像虚拟中继中的概念一样,其中的头像是从照片生成的)由用户提供)的源代码真是太棒了.谢谢.

hello there. this question is simple and straight forward,does anyone know how to write code that generates a 3d photo realistic avatar from a 2d photograph(s) provided by the user(just like the concept in virtual relay,where such an avatar is generated from photographs provided by the user)?source code for this would be awesome.thanks.

推荐答案

我已经在评论中解释了没有足够的信息来构建3D模型,断层扫描等不适定的问题.甚至人眼也无法真正重建这种模式.您宁愿以不同角度拍摄一组照片. 1999年,我从MetaCreation的一些人那里了解了他们的相机,该相机仅使用了两条短裤,但是其中一条是使用特殊结构的照明制成的.在一些伪3D检测器中使用了类似的结构化照明方法,这些伪3D检测器用于构建电子行业中印刷电路板的3D轮廓.抱歉,我无法提供更多详细信息,但是这些方法非常有趣,并且需要非常特殊的硬件.这是一篇有关通过照片构建3D模型的有趣文章:
http://www.pcworld.com/article/11311/build_3d_models_from_photos.html [ ^ ].

我的2D小创意比较琐碎,但对我来说似乎很现实.首先,我建议您加载和使用Inkspace:
http://en.wikipedia.org/wiki/Inkscape [ http://inkscape.org/ [ ^ ].

请运行并使用它.可以将其推荐为开发所有类型的软件图形的主要工具,而不仅限于软件.这个出色的矢量编辑工具提供了许多不同的效果,但是我想引起您对其中两个效果的注意:[Main Menu] =>路径=>跟踪位图和[主菜单] =>路径=>简化.这两种效果可以帮助对照片进行矢量化和变形处理,使其具有卡通般的外观.请注意,简化实际上会使图像更丰富,简化"只是意味着该过程减少了曲线节点的数量,但是却赋予了它更精致的外观.您还可以搜索海报化"的效果(在其他地方,请参见 http://en.wikipedia.org/wiki/Posterization [ ^ ]).由于Inkscape是开源软件,因此您可以找到效果的源代码并学习如何实现它们.

我的另一个更高级但更模糊的想法是后代化.原则上,可以将图像分解为一组具有主导梯度"特征的区域.可以通过内插法重建每个区域的梯度并将其添加到模型中.因此,图像的最终模型应显示一组由Bezier曲线界定的区域,并在每个区域中填充渐变.一些问题可能是将它们平滑地缝在边界上.我认为最适当的方法是……忽略这个问题.取决于分解成区域的方式,此效果可以在区域之间创建可见的颜色边界,就像在经典后代化中一样.它可以支持图像的卡通外观,并且看起来足够自然.

毕竟,包括肖像画在内的整个绘画领域都是关于人类感知的游戏.在大多数图形样式中,人的头部是通过使用面部的一些笔触以及具有一定粗度的曲线来描绘的.现实生活中没有这样的界限!然而,绘画的艺术风格常常表现出线条.人类的感知力从这些不存在的自然图像中重建出人类头部的3D图像.

—SA
I already explained in my comments to the question that there is no enough information to build a 3D model, ill-posed problem like in tomography, etc. Even a human eye do not really reconstruct such mode. You would rather have a set of photographs at different angles. In 1999, I learned from some MetaCreation''s people about their camera which used only two shorts, but one of them was made using specially structured lighting. Similar structured-lighting approach is used in some pseudo-3D detectors used to build a 3D profile of the Printed Circuit Board in electronic industry. Sorry I cannot give much more detail, but those approaches are very interesting and require very special hardware. This is an interesting article about building 3D models from photos:
http://www.pcworld.com/article/11311/build_3d_models_from_photos.html[^].

My little 2D ideas are rather trivial but seem realistic to me. First, I would recommend you to load and use Inkspace:
http://en.wikipedia.org/wiki/Inkscape[^],
http://inkscape.org/[^].

Please run it and play with it. It could be recommended as a primary tool for developing all kind of graphics for software, but not just for software. There are many different effects supplied with this wonderful vector editing tool, but I would like to bring your attention to two of them: [Main Menu] => Path => Trace Bitmap and [Main Menu] => Path => Simplify. These two effects can help to vectorize the photograph and morph it give it some cartoonish look. Note, that simplify actually enriches the image, "simplification" simply means the process reduces the number if curve''s nodes, but it gives it more sophisticated look. You also can search for effects of "posterization" (elsewhere, please see http://en.wikipedia.org/wiki/Posterization[^]). As Inkscape is Open-Source software, you can locate the source code of the effects and learn how to implement them.

My other more advanced but more fuzzy idea is the generalization of posterization. In principle, it''s possible to decompose an image into a set of areas characterized with some "dominating gradient". The gradient withing each area can be reconstructed by interpolation and added to the model. So, the final model of the image should present a set of areas bounded by Bezier curves with gradient fill in each of them. Some problem could be smooth stitching them on their boundaries. I feel that the most adequate approach would be… ignoring this problem. Depending on how decomposition into areas is done, this effect can create visible color boundaries between the areas, like in classical posterization. It could support cartoonish look of the image and look natural enough.

After all, the whole field of painting including portrait painting is about the play with human perception. In most graphical styles, a human head is depicting with the use of some strokes on the face, curved lines with some thickness. There are no such line in real life! Nevertheless, the artistic styles of drawing often show the lines; and human perception reconstructs 3D image of a human head from this non-existent-in-nature images.

—SA


这篇关于照片的头像生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆