在现有轮廓线之间插入缺少的轮廓线 [英] Interpolating missing contour lines between existing contour lines

查看:80
本文介绍了在现有轮廓线之间插入缺少的轮廓线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

等高线(也称为等值线)是在2D标量场中跟踪常数值的曲线.例如,在地理地图中,您可能有轮廓线,通过显示高程恒定的地方来说明地形的高程.在这种情况下,让我们将轮廓线存储为地图上的点列表.

Contour lines (aka isolines) are curves that trace constant values across a 2D scalar field. For example, in a geographical map you might have contour lines to illustrate the elevation of the terrain by showing where the elevation is constant. In this case, let's store contour lines as lists of points on the map.

假设您的地图具有在已知高程处的多条轮廓线,否则您对地图的高程一无所知.假设景观是连续的并且没有任何令人惊讶的事情,您将使用什么算法来填充其他轮廓线以近似地图的未知标高?

Suppose you have map that has several contour lines at known elevations, and otherwise you know nothing about the elevations of the map. What algorithm would you use to fill in additional contour lines to approximate the unknown elevations of the map, assuming the landscape is continuous and doesn't do anything surprising?

很容易找到有关使用轮廓线对单个点的高程进行插值的建议.还有诸如行军广场之类的算法,可以将点高程转换为轮廓线,但是这些算法都不能准确地捕捉到该用例.我们不需要任何特定点的高程.我们只想要轮廓线.当然,我们可以通过以下方法解决此问题:将一个估计高程填充到一个数组中,然后使用Marching Squares基于该数组估计轮廓线,但是该过程的两个步骤似乎不必要地昂贵,并且很可能会引入伪影.当然有更好的方法.

It is easy to find advise about interpolating the elevation of an individual point using contour lines. There are also algorithms like Marching Squares for turning point elevations into contour lines, but none of these exactly capture this use case. We don't need the elevation of any particular point; we just want the contour lines. Certainly we could solve this problem by filling an array with estimated elevations and then using Marching Squares to estimate the contour lines based on the array, but the two steps of that process seem unnecessarily expensive and likely to introduce artifacts. Surely there is a better way.

推荐答案

混合方法:

  • 将等值线展平为折线;

  • flatten the isolines to polylines;

对由折线和边界形成的多边形进行三角剖分;

triangulate the poygons formed by the polylines and the borders;

在每个节点上,估计表面梯度(平面到该节点及其邻居的最小二乘拟合);

on every node, estimate the surface gradient (least-square fit of a plane to the node and its neighborrs);

在每个三角形中,考虑需要沿其插值并计算端点上的导数的两个侧面(根据已知的梯度和侧面方向);

in every triangle, consider the two sides along which you need to interpolate and compute the derivative at endpoints (from the known gradients and the side directions);

沿这些方向使用Hermite插值法并求解所需的等值线;

use Hermite interpolation along these sides and solve for the desired iso-levels;

加入在两侧获得的点.

此方法应该在复杂度和平滑度之间取得良好的折衷.它确实重建了一个连续的表面(除了下面的说明以外).

This method should be a good tradeoff between complexity and smoothness. It does reconstruct a continuous surface (except maybe for the remark below).

请注意,在某些情况下,您将获得三次立方的解.如果每边有三个,则按顺序将它们加入.否则,请决定要加入哪个并使用剩下的两个来闭合曲线.

Note that is some cases, yo will obtain three solutions of the cubic. If there are three on each side, join them in order. Otherwise, make a decision on which to join and use the remaining two to close the curve.

这篇关于在现有轮廓线之间插入缺少的轮廓线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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