双线性插值在四边形上
我正在从四边形的顶点到四边形内的任何随机点进行插值数据。我通过首先进行坐标转换来实现此功能,该转换将四边形重塑到单位正方形,然后使用双线性插值。 Python库是否已经实施了?
I am interpolating data from the vertices of a quadrilateral to any random point inside the quadrilateral. I implement this by first doing a coordinate transformation which reshapes the quadrilateral to a unit square and then using bilinear interpolation.
Does any of the python libraries already have an implementation to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

四边形角落之间的双线性插值使坐标
使该系统形成一个未知的二次方程的系统
u
,v
。如果p
在四边形内,则u,vε[0,1]
。如果我们将点和跨产品与
p11-p10-p01+p0
一起使用,则该系统采用的表格我们从中消除了
v
,而v
是二次统一的。计算根部并将其保存在域中。从
u
您获得v
。Bilinear interpolation between the corners of a quadrilateral gives the coordinates
This forms a system of two quadratic equations in the unknowns
u
,v
. IfP
is inside the quadrilateral,u, v ε [0, 1]
.If we take the dot and cross products with
P11-P10-P01+P0
, the system takes the formfrom which we eliminate
v
bywhich is quadratic univariate. Compute the roots and keep the one in the domain. From
u
you getv
.