Euclidean-PCL-Python (0%)
1. Eucliean Cluster
์ค์ : colorlist is a static variable you should define it outside the function getcolorlist, I defined it after if _name == โ__mainโ: get_color_list.color_list = []
def do_euclidean_clustering(white_cloud):
'''
:param cloud_objects:
:return: cluster cloud and cluster indices
'''
tree = white_cloud.make_kdtree()
# Create Cluster-Mask Point Cloud to visualize each cluster separately
ec = white_cloud.make_EuclideanClusterExtraction()
ec.set_ClusterTolerance(0.015)
ec.set_MinClusterSize(50)
ec.set_MaxClusterSize(20000)
ec.set_SearchMethod(tree)
cluster_indices = ec.Extract()
cluster_color = get_color_list(len(cluster_indices))
color_cluster_point_list = []
for j, indices in enumerate(cluster_indices):
for i, indice in enumerate(indices):
color_cluster_point_list.append([white_cloud[indice][0],
white_cloud[indice][1],
white_cloud[indice][2],
rgb_to_float(cluster_color[j])])
cluster_cloud = pcl.PointCloud_PointXYZRGB()
cluster_cloud.from_list(color_cluster_point_list)
return cluster_cloud,cluster_indices
# Euclidean Clustering
white_cloud= XYZRGB_to_XYZ(cloud_objects)
cluster_cloud,cluster_indices = do_euclidean_clustering(white_cloud)Yuchao's blogspot
๋ถ๋ฆฌ์ํ
์ ์ ํ eps ์ ํ๋ ๋ฐฉ๋ฒ : 1. StandardScaler 2. MinMaxScaler
Region growing segmentation
Last updated
Was this helpful?