OpenCV 中的位移贴图过滤器
我很好奇如何实现 此处使用 OpenCV 演示了效果。我认为这是某种位移贴图过滤器,但我不能 100% 确定。
该页面完全加载后,移动鼠标以查看背景图像移动(这就是我正在寻找的效果)。
是否可以?我该怎么做呢?
I'm curious to know how one can implement the effect demonstrated here using OpenCV. I think it's some sort of displacement map filter but I'm not 100% sure.
After that page has fully loaded, move the mouse around to see the background image move (it's the effect I'm looking for).
Is it possible? How would I go about doing it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
自从我问这个问题以来已经快两年了,我想是时候回答它了:使用 OpenCV 实现这个过滤器的源代码可以在我的 GitHub 存储库。
该实现基于 Adobe Flash DisplacementMapFilter 的文档。
我建议人们阅读另一个教程: Psyark 的 DisplacementMapFilter 教程。它很旧但很准确。
结果:
It's been almost 2 years since I've asked this question and I think it's time to answer it: the source code that implements this filter using OpenCV can be found in my GitHub repo.
The implementation is based on the documentation of Adobe Flash DisplacementMapFilter.
There's another tutorial I recommend people to read: Psyark’s DisplacementMapFilter Tutorial. It's old but accurate.
The result:
当然,我不知道他们在这个页面上使用什么。但是,您可以使用应用于平面的视差贴图来获得类似的效果。在这种情况下,没有遮挡,这使得速度更快。
此线程中有一个着色器实现,应该很容易转换为一个内核。
这里是另一个链接使用这种技术拍摄照片。
Naturally, I don't know what they are using on this page. But you can get a similar effect using Parallax Mapping applied to a flat surface. In this case there is no occlusion, which makes it faster.
There is a shader implementation in this thread which should be easy enough to translate to a kernel.
Here is another link that uses this technique for photos.