覆盖“结构化玻璃”对 iPhone 摄像头的影响 - 一般说明
我目前正在尝试编写一个应用程序,它能够显示通过 iPhone 相机看到的玻璃效果。 我说的不是简单、均匀的玻璃,而是像这样的玻璃:
现在我已经将其分为两个问题:
1)对 iPhone 呈现的 2D 帧应用一些图像过滤器相机。这已经完成并且似乎是可能的,例如在应用程序中: faceman
2) 我需要获取客户提供给我的一块玻璃的单独照明属性。现在基本上,必须有一种方法来读取有关玻璃如何扭曲和倾斜图像的信息。我认为也许可以制作一张玻璃板的高分辨率图片,放在棋盘图像上,并以某种方式对其进行分析。
现在,我主要是在寻找文献、网络链接,了解你们认为我可以如何从 2 开始。它不需要精确,最后我只需要一些看起来大约像我想展示的玻璃板的东西。我什至不知道在哪里搜索物理、图像过滤或计算摄影书籍。
编辑:我目前正在考虑,一个简单的解决方案可能是对相机馈送顶部的纹理进行凹凸贴图,我对此提出了另一个问题 此处。
I'm currently trying to write an app, that would be able to show the effects of glas, as seen through the iPhone Camera.
I'm not talking about simple, uniform glas but glass like this:
Now I already broke this into two problems:
1) Apply some Image Filter to the 2D-frames presented by the iPhone Camera. This has been done and seems possible, e.g. in the app: faceman
2) I need to get the individual lighting properties of a sheet of glas that my client supplies me with. Now basicly, there must be a way to read the information about how the glas distorts ands skews the image. I think It might be somehow possible to make a high-res picture of the plate of glasplate, laid on a checkerboard-image and somehow analyze this.
Now, I'm mostly searching for literature, weblinks on how you guys think I could start at 2. It doesn't need to be exact, in the end I just need something that looks approximately like the sheet of glass I want to show. And I'm don't even know where to search, Physics, Image Filtering or Comupational Photography books.
EDIT: I'm currently thinking, that one easy solution could be bump-mapping the texture on top of the camera-feed, I asked another question on this here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要从 OpenGL 开始。您想要有效地拥有一个纹理 - 类似于您上面的纹理 - 替换它下面的纹理(实时相机视图)以给出深度和扭曲的印象。这是一个“不平凡”的问题,因为虽然它是该领域中相当标准的问题,但如果您来自没有图形或 OpenGL 经验的背景,那么您可能会遇到非常陡峭的学习曲线。
简而言之,在 iOS 上实现这一目标的唯一方法是使用 OpenGL,这应该是您的起点。苹果公司有一些关于此事的指南,但你最好还是去其他地方看看。有一些有用的书籍,例如 OpenGL ES 2.0 编程指南,可以让您走上正轨,但从哪里开始取决于您对 3D 图形和 C 的熟悉程度。
You need to start with OpenGL. You want to effectively have a texture - similar to the one you've got above - displace the texture below it (the live camera view) to give the impression of depth and distortion. This is a 'non-trivial' problem, in that whilst it's a fairly standard problem in its field if you're coming from a background with no graphics or OpenGL experience you can expect a very steep learning curve.
So in short, the only way you can achieve this realistically on iOS is to use OpenGL, and that should be your starting point. Apple have a few guides on the matter, but you'll be better off looking elsewhere. There are some useful books such as the OpenGL ES 2.0 Programming Guide that can get you off on the right track, but where you start would depend on how comfortable you are with 3D graphics and C.
只是想补充一点,我使用 Khronos OpenGl 中的折射示例解决了这个旧答案ES SDK。
写了一篇带有相关图片的博客文章:
用折射
Just wanted to add that I solved this old answer using the refraction example in the Khronos OpenGl ES SDK.
Wrote a blog-entry with pictures about it :
simulating windows with refraction