平均矢量图像以获得中间图像
我正在寻找一种算法,该算法采用矢量图像数据(例如边缘集)并插入另一组边缘,该边缘是两个(或更多)集的“平均值”。
换句话说,它就像 Adobe Flash 一样,您可以“补间”两个矢量图像,软件会自动计算中间图像。因此,您只需指定起始图像和结束图像,然后 Flash 就会处理所有中间图像。
有没有既定的算法可以做到这一点?特别是在边数不同的情况下?
I am looking for an algorithm that takes vector image data (e.g. sets of edges) and interpolate another set of edges which is the "average" of the two (or more) sets.
To put it in another way, it is just like Adobe Flash where you "tween" two vector images and the software automatically computes the in-between images. Therefore you only specify the starting image and end image, then Flash takes care of all the in-between images.
Is there any established algorithm to do this? Especially in cases like different number of edges?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
边缘到底是什么意思?我们谈论的是使用曲线的平滑矢量图形吗?
基本策略是简单地对控制多边形的点和方向进行线性插值。
基本上,您可以简单地取两个对应的点(每个曲线/矢量形式之一)并用以下值对它们进行插值:
x(t) = (1-t)*p1 + t*p2 with t in [0,1]
(t=0.5 当然会给你两者之间的平均值)
由于矢量图形通常使用曲线,你需要对每个控制点的方向向量做同样的事情得到平均曲线的方向向量。
但一个大问题是匹配每个控制多边形的正确点,尤其是当两条曲线具有不同阶数时。您可以尝试对一个进行度数提升以匹配另一个的度数,然后将它们一一分配给彼此并进行插值。
也许这有帮助...
What exactly do you mean by edges? Are we talking about smooth vector graphics that use curves?
Well a basic strategy would be to simply do a linear interpolation on the points and directions of your control polygon.
Basically you could simply take two corresponding points (one of each curve/vector form) and interpolate them with:
x(t) = (1-t)*p1 + t*p2 with t in [0,1]
(t=0.5 would then of course give you the average between the two)
Since vector graphics usually use curves you'd need to do the same with the direction vector of each control point to get the direction vector of the averaged curve.
One big problem though is to match the right points of each control polygon, especially if both curves have a different degree. You could try doing a degree elevation on one to match the degree of the other and then one by one assign them to each other and interpolate.
Maybe that helps...