我有一個大小爲AxBxC的3D網格,網格中的點之間的距離爲d。給定若干點,給出以下假設,找出每個網格點的最近點距離(每個網格點應包含到點雲最近點的距離)的最佳方法是什麼?查找到統一網格上的點雲中最近點的距離
假設有A,B和C是相當大的相對於d,給人的也許500x500x500一個網格,將有大約1萬點。
另外假設,如果到最近點的距離超出距離D,我們不關心最近點距離,並且可以安全地設置爲一個大數目(D可能是d的2到10倍)
由於會有的網格點和點大量從一個簡單的窮舉搜索:
for each grid point:
for each point:
if distance between points < minDistance:
minDistance = distance between points
是不是一個很好的選擇。
我想這樣做的線沿線的東西:
create a container of size A*B*C where each element holds a container of points
for each point:
define indexX = round((point position x - grid min position x)/d)
// same for y and z
add the point to the correct index of the container
for each grid point:
search the container of that grid point and find the closest point
if no points in container and D > 0.5d:
search the 26 container indices nearest to the grid point for a closest point
.. continue with next layer until a point is found or the distance to that layer
is greater than D
基本上是:把點水桶和做一個徑向向外搜索,直到找到每個網格點一個百分點。這是解決問題的好方法,還是有更好/更快的方法?優選用於平行化的解決方案。
我認爲@Mark強調了一個非常重要的觀點:這是一次性計算還是雲計算會在每個步驟之間進行併發生相同的計算?一個易於更新的結構將是至關重要的,如果多個計算將被鏈接,因此它將形成解決方案... – 2010-04-29 11:10:23
對不起,我錯過了指出。點雲確實會移動,計算必須在每個時間步重新進行。 – erik 2010-04-29 14:12:13