图像变形 - Bulge Effect 算法 [英] Image Warping - Bulge Effect Algorithm
本文介绍了图像变形 - Bulge Effect 算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以指向图像变形算法?专门针对凸起效果?
Can any point to image warping algorithms? Specifically for bulge effect?
推荐答案
看看我是否明白你想要什么.假设您的图像坐标从 0 到 1.
See if I understood what you want. Suppose your image coordinates go from 0 to 1.
如果你这样做:
r = Sqrt[(x - .5)^2 + (y - .5)^2]
a = ArcTan[x - .5, y - .5]
rn = r^2.5/.5
然后根据以下内容重新映射您的像素:
And then remap your pixels according to:
x -> rn*Cos[a] + .5
y -> rn*Sin[a] + .5
你得到:
您可以调整参数以获得更大或更小的凸起.
You may adjust the parameters to get bigger or smaller bulges.
编辑
让我们看看我是否理解您对翘曲的评论.以下图片使用
Let's see if I understood your comment about warping. The following images are generated using
rn = r^k {k: 1 ... 2}:
这篇关于图像变形 - Bulge Effect 算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文