蟒蛇。如何子采样点(X,Y)

时间:2016-05-26 20:45:06

标签: python

我有一个包含10,000个点[x,y]的列表,但它们彼此非常接近,所以我想用给定的距离阈值对该列表进行子采样。 我不确定哪种方式或方式最好。

这是我的伪代码

coordinates = [x,y]
thresholdDist = 'some float value'
subsample = []
points = 'pick-some-random-points-from-coordinates'
for p in points:
    for c in coordinates:
        dst=EuclideanDistance(p, c)
            if dst <= thresholdDist:
                subsample.append(p and c)
set(subsample)

任何建议都会很棒。感谢

0 个答案:

没有答案
相关问题