Skip to main content
. 2022 Feb 7;22(3):1262. doi: 10.3390/s22031262
Algorithm 2 The pseudo-code of refinement
Input: initial clusters partition
  the normal of each point N,
  the normals of orientation planes Plane,
  the number of orientation planes numPlanes,
  the number of points numPoints
  the maximum number of iterations maxNumIters
  the impact factor λ  
  the number of neighbor voxels used for the search nnFilledVoxels
  voxel list V
Output: updated clusters partition
  ω=λ/numNeighbors
  For i=0 to numPoints-1 do
    For j=0 to numPlanes-1 do
      scoreNormal[i][j] = N[i]·Plane[j]
    End For
  End For
  For k=0 to maxNumIters -1 do
    For i=0 to V.size-1 do
      voxScoreSmooth[Vi][ ] = 0
      For j=0 to Vi.size-1 do
        voxScoreSmooth[Vi][partition[Vi[j]]]++//calculate the voxel smooth score
      End For
    End For
    For i=0 to numPoints-1 do
      For j=0 to numPlanes-1 do
        v=filledVoxels[i]//the voxel at which the i-point is located
        Find the neighboring voxels and store them in nnFilledVoxels
        scoreSmooth[i][j] = 0
        For n=0 to nnFilledVoxels.size-1 do
          scoreSmooth[i][j] += voxScoreSmooth[nnFilledVoxels[n]][j]
        End For
      score[j]= scoreNormal[i][j] + ω•scoreSmooth[i][j]
      End For
    Cluster the point to j which related score is the highest
    tmpPartition[i]=clusterIndex
    End For
    partition[i]=clusterIndex
  End For