从正常图像创建鱼眼效果的算法 [英] Algorithm for creating fisheye effect from a normal image

查看:175
本文介绍了从正常图像创建鱼眼效果的算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个OpenGL片段着色器,它将常规图像转换为包含鱼眼效果的图像.这就是我所说的鱼眼效应(http://www.marcofolio.net/photoshop/create_a_fish_eye_lens_effect_in_photoshop.html).

I am trying to create an OpenGL fragment shader that converts a normal image to an image that contains fish eye effect. This is what i mean by fish eye affect (http://www.marcofolio.net/photoshop/create_a_fish_eye_lens_effect_in_photoshop.html).

正常图像"是指在3d交互式环境中从虚拟相机拍摄的渲染图像,而不是从真实相机拍摄的图像,但是我想这在这个问题上并没有多大区别.

By normal image i mean a rendered image taken from a virtual camera in a 3d interactive environment, not an image taken from a real camera, but i guess that doesnt really make much difference in terms of this problem.

有没有人知道Photoshop的工作方式,或者在哪里可以找到解释该算法的材料?

Does anyone have any idea how Photoshop does it, or where i can find material that explains the algorithm?

谢谢

推荐答案

在这种情况下,您甚至根本不需要着色器.从事物的声音中,您可以将原始图像作为某种位图.如果是这样,只需将其用作纹理并将其附加到球体上即可.

You don't really even need a shader in this case. From the sound of things, you have your original image as a bitmap of some sort. If that's so, just use it as a texture, and attach it to a sphere.

当然,您可以使用一个着色器(或一对着色器,实际上),但是除非您打算做的事超出您的描述,否则这样做不会给您带来太大的好处(如果有的话).

Of course, you can use a shader (or pair of shaders, really), but unless you're going to do more than you've described, doing so won't gain you much (if anything).

这篇关于从正常图像创建鱼眼效果的算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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