在2D中随机点上的值插值 [英] Interpolation of values on random points in 2D
问题描述
让我从一个例子开始.在OpenGL中,当您在每个顶点上绘制具有不同颜色的三角形时,将插值介于它们之间的点上的颜色值:
Let me start with an example. In OpenGL when you draw a triangle with different colors on each vertex, values of color on points in between is interpolated:
现在,可以说我有随机点的集合,可以这样表示(黑色被认为是缺乏颜色):
Now, lets say I have collection of random points, which can be represented like that (black is counted as a lack of color):
如何有效地对这些点进行插值,以便获得均匀填充的图片?
How can I efficiently interpolate those points so I will get evenly filled picture?
推荐答案
我的建议是用一个值编码您的颜色,然后从(xi,yi,ci)进行表面拟合c = f(x,y)其中xi和yi是点i的(x,y)坐标,而ci是点i处的编码颜色值.您无需在边界空间做额外的处理,因为评估边界点的颜色值与评估任何点的颜色相同.
My suggestion is to to encode your colors with a value and then do a surface fitting c=f(x,y) from (xi, yi, ci) where xi and yi are the (x,y) coordinates of point i and ci is the encoded color value at point i. You don't need to do extra handle at boundary space as evaluating the color value at a boundary point is the same as evaluating the color at any point.
这篇关于在2D中随机点上的值插值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!