哪位朋友能共享一下三维密度聚类DBSCAN算法的程序,不胜感激

现在在做一个三维点云降噪的工作,想应用三维的DBSCAN技术,但是网上基本找不到三维密度聚类的程序参考,哪位朋友有这方面的资源能不能帮个小忙,共享一下三维密度聚类的程序参考一下

既然是应用,那就直接调用开源库:
Python库:scikit-learn 中的 sklearn.cluster.dbscan,参考链接:http://scikit-learn.org/stable/modules/generated/sklearn.cluster.dbscan.html
Matlab库:DBSCAN,参考链接:https://cn.mathworks.com/matlabcentral/fileexchange/53847-dbscan

distance<-dist(x,method = "euclidean")
distmat<-matrix(data = 0,nrow = n,ncol = n)

for (i in 1:(n-1)){
for (j in (i+1):n){
distmat[i,j]<-distance[n*(i-1)-i*(i-1)/2+j-i]
distmat[j,i]<-distmat[i,j]
}
}

distlogic=as.matrix(distmat<=1)

postd=distlogic
time=0
repeat{
pred=postd
postd=as.matrix((pred%*%distlogic)!=0)

time=time+1
if (time>20|identical(postd,pred)) break
}
final=postd

linkage=rep(0,times = n)
color=1
for (i in 1:(n-1)){
if (linkage[i]==0){
linkage[i]=color# a isolate point is identified with a new color assigned to it
color=color+1
}

for (j in (i+1):n){
if (final[i,j]==T){
linkage[j]=linkage[i]
}
}
}

library(RColorBrewer)
realcolor=brewer.pal(n = 8,name = "Accent")
plot(x,type="n")
points(x,col=realcolor[linkage],pch=19)