高度图生成算法? [英] Heightmap generation algorithm?

查看:612
本文介绍了高度图生成算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找在互联网附近,但没有找到一个完美的算法,这方面的问题:

I was looking around the internet and couldn't find a perfect algorithm for this particular problem:

我们的客户有一组点,以及每个点的权重数据,如可通过这一形象来证明:

Our customer have a set of points and weight data along with each point as can be demonstrated by this image:

其中,我们有一个地理信息系统,可以产生高度图或整理从这些点的地形数据和它们的权重值,但因为我们有近一千个数据点,这些都会随时间而改变,我们想创建自己的工具来自动生成这些高度图。

Of which, we have a GIS program that could generate a "heightmap" or a sort of terrain data from these points and their weight values but as we have near a thousand points of data and that these will change over time, we would like to create our own tools to auto-generate these heightmaps.

到目前为止,我试图计算其到最近的数据点的距离每个像素的重量 SQRT((X1 - X2)^ 2 +(Y1 - Y2)^ 2) 和施加的重量和距离的因素的数据点的颜色,以产生所得渐变颜色为该特定的像素:

So far, I've tried to calculate the weight for each pixel from its distance to the closest data point with Sqrt((x1 - x2) ^ 2 + (y1 - y2) ^ 2) and applying weight and distance factor to the data point's color to produce the resulting gradient color for that particular pixel:

您可以看到,仍然有问题的数据点的某些配置和算法有时会产生相当的多边形图像时有大量的数据点。理想的结果应该看起来更像是一个省略号而不像一个多边形。

You can see that there are still problems with certain configuration of data points and the algorithm sometimes produce a rather polygonal image when there is a lot of data points. The ideal result should looks more like an ellipsis and less like a polygon.

下面是从梯度上升维基百科的文章这表明了结果,我想要一个形象的例子:

Here is one example image from wikipedia article on gradient ascent which demonstrates the result I want:

的梯度上升算法是我不感兴趣。我很感兴趣;是算法来计算该照片摆在首位原有的功能,提供的数据点的权重。

The gradient ascent algorithm is not of my interest. What I'm interested in; is the algorithm to calculate the original function in that picture in the first place, provided data points with weights.

我还没有采取任何类拓扑数学,但我可以做一些微积分。我想我可能会丢失一些东西,而我失去了我应该怎么输入,谷歌的搜索框。

I've not taken any class in topological maths, but I can do some calculus. I think I may be missing something and am rather lost at what should I type in that Google search box.

我需要一些指引。

谢谢!

推荐答案

您要找的是曲面插补。

部分产品存在要做到这一点(这里是一个

Some products exist to do this (here's one)

新的函数/齿条/其他数学结构就可以在所要求的分辨率提供了高度的地图查询。

The resulting function/spline/other mathematical construct can then be interrogated at the required resolution to supply the height map.

您插补功能

Sqrt((x1 - x2) ^ 2 + (y1 - y2) ^ 2)

类似反距离权重的方法,除非你是将任意过滤器和丢弃许多其他的数据点。

Is similar to Inverse Distance Weighted methods except you are applying an arbitrary filter and discarding many of the other data points.

这些技术大多依赖于合理的样本数量和地形样的行为支撑的值。

Most of these techniques rely on a reasonable number of samples and 'terrain-like' behaviour underpinning the values.

我建议使用的重量为高度样品,并试图简单Shepard的方法在第二连杆通过取到的总高度值的采样点的贡献的比例在一个插补点(不过滤任何象素开始与)你可以混合样品的颜色在这些比率也颜色的点。使用强度(粗略地讲在简单的RGB空间中的灰度)来显示的高度或在黑色加轮廓线像示例图像确实

I suggest using the weight as the height sample and trying the simple Shepard's Method in the second link (do not filter any pixels to start with) by taking the proportion of a sample points contribution to the overall height value at an interpolation point you can blend the colours of the samples in those ratios to also colour the point. Use the intensity (roughly speaking the grayscale in simple RGB space) to display the height or add contour lines in black like the example image does.

这篇关于高度图生成算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆