gpt4 book ai didi

algorithm - 为闭合多边形的 Douglas-Peucker 算法找到好的起点

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:02:47 26 4
gpt4 key购买 nike

我正在尝试使用 Douglas-Peucker 算法减少多边形的顶点 - 这对于线条和路径非常有效。

我的问题是我要优化的多边形是封闭的。 When choosing 2 random adjacent points the optimization works well - except for the start and end point - since they are fixed and can't be optimized.

有什么好的方法可以选择起点吗?

最佳答案

我会随机选择一个点(例如:所有点列表中的“第一个”点)并找到最远的点。这类似于搜索距线段最远点的算法的普通步骤。

关于algorithm - 为闭合多边形的 Douglas-Peucker 算法找到好的起点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8877257/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com