散乱二维数据的线性插值 [英] Linear Interpolation of Scattered 2D Data
问题描述
所以我有一些不规则间隔的数据,我想插入到常规网格上。 (我想完全和这一个似乎也试图做关于我的情况,但他们的答案不太适用。
其他人有同样的问题,但没有解决方案。
注意:我正在使用JavaFX-2,所以如果我可以某种方式使用他们的 Interpolator
这个类很棒。
。
。< br>
编辑:
如果有人偶然发现并希望了解我最终使用的内容,那么这是BGU的Delaunay Triangulation实现:
主要网站
代码API
如果线性插值已足够,我建议你使用带有Gouraud着色的3d网格进行绘图:
- 将2d点云转换为网格(你可以谷歌搜索现有算法)
- 将每个点的z值映射到顶点'颜色
- 使用Gouraud着色来启用顶点颜色之间的线性插值
- 在网格顶部创建一个相机并使用其他正常投影(以避免透视)
你说你可以使用JavaFX。 JavaFX支持3d场景,您可以构建自己的网格。但是看看TriangleMesh的JavaDoc,我找不到任何设置顶点颜色的方法,我发现只有一个方法来设置(x,y,z)和(u,v)(纹理坐标)坐标。
So I have some irregularly spaced data that I want to interpolate onto a regular grid. (I want to do exactly this but in Java) Here's a picture:
Basically I have the x and y coordinates of each point and a z value associated with each point and I want to interpolate between them and fill in the center of my image.
What is the best way to do this using Java? Is there a built in 2D interpolation library I can use or should I try a "roll my own" approach?
I want to do exactly what this answer specifies but in Java.
This post and this one also seem to be trying to do about what I am but their answers don't quite apply.
Someone else with the same problem but no solution.
Note: I am using JavaFX-2 so if I could somehow use their Interpolator
class that'd be great.
.
.
EDIT:
If anyone stumbles upon this and wants to know what I ended up using, it was a Delaunay Triangulation implementation from BGU:
Main Site
Code API
If linear interpolation is sufficient, I suggest you to use a 3d mesh with Gouraud Shading for drawing:
- Convert the 2d point cloud to a mesh (you can google for existing algorithms)
- Mapping the z value of each point to the vertex' color
- Using Gouraud Shading to enable linear interpolation between the vertex colors
- Creating a camera on top to the mesh and using a othonormal projection (to avoid perspective)
You say that you can use JavaFX. JavaFX supports 3d scenes and you can build your own meshes. But looking into the JavaDoc of TriangleMesh, I can't find any method to set the vertex color I found only a method to set the (x,y,z) and (u,v) (texture coordinates) coordinates.
这篇关于散乱二维数据的线性插值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!