๐Ÿ’ป
Tutorial
  • INTRO
  • Part 0 (๊ฐœ์š”)
    • README
    • 3D ์˜์ƒ์ฒ˜๋ฆฌ
    • [๋ณ„์ฒจ] PCL & PCD๋ž€ (100%)
    • chapter02 : PCL ์„ค์น˜ (100%)
    • chapter03 : ROS ์‹ค์Šต ์ค€๋น„(100%)
  • Part 1 (์ดˆ๊ธ‰)
    • README
    • PCL ๊ธฐ๋ฐ˜ ๋กœ๋ด‡ ๋น„์ ผ
    • [๋ณ„์ฒจ] ํŒŒ์ผ ์ƒ์„ฑ ๋ฐ ์ž…์ถœ๋ ฅ (70%)
      • PCL-Cpp (70%)
      • PCL-Python (70%)
      • Open3D-Python (70%)
      • ROS ์‹ค์Šต (90%)
    • Filter
    • [๋ณ„์ฒจ] ์ƒ˜ํ”Œ๋ง (70%)
      • ๋‹ค์šด์ƒ˜ํ”Œ๋ง-PCL-Cpp (70%)
      • ๋‹ค์šด์ƒ˜ํ”Œ๋ง-PCL-Python (50%)
      • ์—…์ƒ˜ํ”Œ๋ง-PCL-Cpp (70%)
      • ROS ์‹ค์Šต (90%)
    • [๋ณ„์ฒจ] ๊ด€์‹ฌ ์˜์—ญ ์„ค์ • (70%)
      • PCL-Cpp (70%)
      • PCL-Python (70%)
      • ROS ์‹ค์Šต (90%)
    • [๋ณ„์ฒจ] ๋…ธ์ด์ฆˆ ์ œ๊ฑฐ (70%)
      • PCL-Cpp (70%)
      • PCL-Python (50%)
      • ROS ์‹ค์Šต (90%)
  • Part 2 (์ค‘๊ธ‰)
    • README
    • Kd-Tree/Octree Search
    • Chapter03 : Sample Consensus
    • [๋ณ„์ฒจ] ๋ฐ”๋‹ฅ์ œ๊ฑฐ (RANSAC) (70%)
      • PCL-Cpp (70%)
      • PCL-Python (70%)
      • ROS ์‹ค์Šต (90%)
    • ๊ตฐ์ง‘ํ™” (70%)
      • Euclidean-PCL-Cpp (70%)
      • Euclidean-PCL-Python (0%)
      • Conditional-Euclidean-PCL-Cpp (50%)
      • DBSCAN-PCL-Python (0%)
      • Region-Growing-PCL-Cpp (50%)
      • Region-Growing-RGB-PCL-Cpp (50%)
      • Min-Cut-PCL-Cpp (50%)
      • Model-Outlier-Removal-PCL-Cpp (50%)
      • Progressive-Morphological-Filter-PCL-Cpp (50%)
    • ํฌ์ธํŠธ ํƒ์ƒ‰๊ณผ ๋ฐฐ๊ฒฝ์ œ๊ฑฐ (60%)
      • Search-Octree-PCL-Cpp (70%)
      • Search-Octree-PCL-Python (70%)
      • Search-Kdtree-PCL-Cpp (70%)
      • Search-Kdtree-PCL-Python (70%)
      • Compression-PCL-Cpp (70%)
      • DetectChanges-PCL-Cpp (50%)
      • DetectChanges-PCL-Python (50%)
    • ํŠน์ง• ์ฐพ๊ธฐ (50%)
      • PFH-PCL-Cpp
      • FPFH-PCL-Cpp
      • Normal-PCL-Cpp (70%)
      • Normal-PCL-Python (80%)
      • Tmp
    • ๋ถ„๋ฅ˜/์ธ์‹ (30%)
      • ์ธ์‹-GeometricConsistencyGrouping
      • SVM-RGBD-PCL-Python (70%)
      • SVM-LIDAR-PCL-Python (0%)
      • SVM-ROS (0%)
    • ์ •ํ•ฉ (70%)
      • ICP-PCL-Cpp (70%)
      • ICP-ROS ์‹ค์Šต (10%)
    • ์žฌ๊ตฌ์„ฑ (30%)
      • Smoothig-PCL-Cpp (70%)
      • Smoothig-PCL-Python (70%)
      • Triangulation-PCL-Cpp (70%)
  • Part 3 (๊ณ ๊ธ‰)
    • README
    • ๋”ฅ๋Ÿฌ๋‹ ๊ธฐ๋ฐ˜ ํ•™์Šต ๋ฐ์ดํ„ฐ ์ƒ์„ฑ (0%)
      • PointGAN (90%)
      • AutoEncoder (0%)
    • ๋”ฅ๋Ÿฌ๋‹ ๊ธฐ๋ฐ˜ ์ƒ˜ํ”Œ๋ง ๊ธฐ๋ฒ• (0%)
      • DenseLidarNet (50%)
      • Point Cloud Upsampling Network
      • Pseudo-LiDAR
    • ๋”ฅ๋Ÿฌ๋‹ ๊ธฐ๋ฐ˜ ์ž์œจ์ฃผํ–‰ ํƒ์ง€ ๊ธฐ์ˆ  (0%)
    • ๋”ฅ๋Ÿฌ๋‹ ๊ธฐ๋ฐ˜ ์ž์œจ์ฃผํ–‰ ๋ถ„๋ฅ˜ ๊ธฐ์ˆ  (0%)
      • Multi3D
      • PointNet
      • VoxelNet (50%)
      • YOLO3D
      • SqueezeSeg
      • butNet
  • Snippets
    • PCL-Snippets
    • PCL-Python-Helper (10%)
    • Lidar Data Augmentation
  • Appendix
    • ์‹œ๊ฐํ™”Code
    • ์‹œ๊ฐํ™”ํˆด
    • Annotationํˆด
    • Point Cloud Libraries (0%)
    • ๋ฐ์ดํ„ฐ์…‹
    • Cling_PCL
    • ์ฐธ๊ณ  ์ž๋ฃŒ
    • ์ž‘์„ฑ ๊ณ„ํš_Tips
    • ์šฉ์–ด์ง‘
Powered by GitBook
On this page
  • 1. Eucliean Cluster
  • Region growing segmentation

Was this helpful?

  1. Part 2 (์ค‘๊ธ‰)
  2. ๊ตฐ์ง‘ํ™” (70%)

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

# Euclidean Clustering
white_cloud = XYZRGB_to_XYZ(white_cloud) # <type 'pcl._pcl.PointCloud'>
tree = white_cloud.make_kdtree() # <type 'pcl._pcl.KdTree'>
ec = white_cloud.make_EuclideanClusterExtraction()
ec.set_ClusterTolerance(0.02) # for hammer
ec.set_MinClusterSize(10)
ec.set_MaxClusterSize(250)
ec.set_SearchMethod(tree)
cluster_indices = ec.Extract() # indices for each cluster (a list of lists)
# Assign a color to each cluster
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])])
# Create new cloud containing all clusters, each with unique color
cluster_cloud = pcl.PointCloud_PointXYZRGB()
cluster_cloud.from_list(color_cluster_point_list)
# publish to cloud
ros_cluster_cloud = pcl_to_ros(cluster_cloud)
# save to local
pcl.save(cluster_cloud, 'cluster.pcd')

๋ถ„๋ฆฌ์ˆ˜ํ–‰

# Euclidean Clustering
def euclid_cluster(cloud):
    white_cloud = XYZRGB_to_XYZ(cloud) # Apply function to convert XYZRGB to XYZ
    tree = white_cloud.make_kdtree()
    ec = white_cloud.make_EuclideanClusterExtraction()
    ec.set_ClusterTolerance(0.015)
    ec.set_MinClusterSize(20)
    ec.set_MaxClusterSize(3000)
    ec.set_SearchMethod(tree)
    cluster_indices = ec.Extract()

    return cluster_indices, white_cloud



def cluster_mask(cluster_indices, white_cloud):
    # Create Cluster-Mask Point Cloud to visualize each cluster separately
    #Assign a color corresponding to each segmented object in scene
    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] )
                                           ])

    #Create new cloud containing all clusters, each with unique color
    cluster_cloud = pcl.PointCloud_PointXYZRGB()
    cluster_cloud.from_list(color_cluster_point_list)

    return cluster_cloud


cluster_indices, white_cloud = euclid_cluster(white_cloud)
get_color_list.color_list = []

์ ์ ˆํ•œ eps ์ •ํ•˜๋Š” ๋ฐฉ๋ฒ• : 1. StandardScaler 2. MinMaxScaler

Region growing segmentation

PreviousEuclidean-PCL-Cpp (70%)NextConditional-Euclidean-PCL-Cpp (50%)

Last updated 5 years ago

Was this helpful?