💻
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
  • pcl_helper.py
  • Documentation for pcl_helper.py
  • Functions:

Was this helpful?

  1. Snippets

PCL-Python-Helper (10%)

PreviousbutNetNextLidar Data Augmentation

Last updated 5 years ago

Was this helpful?

pcl_helper.py

,

random_color_gen() : Generates a random set of r,g,b values

  • Return: a 3-tuple with r,g,b values (range 0-255)

ros_to_pcl(sensor_msgs/PointCloud2) : Converts sensor_msgs/PointCloud2 to XYZRGB Point Cloud

  • Return: pcl.PointCloud_PointXYZRGB

pcl_to_ros(pcl.PointCloud_PointXYZRGB): Converts XYZRGB Point Cloud to sensor_msgs/PointCloud2

  • Return: sensor_msgs/PointCloud2

XYZRGB_to_XYZ(XYZRGB_cloud): Converts XYZRGB Point Cloud to XYZ Point CLoud

  • Return: pcl.PointCloud

XYZ_to_XYZRGB(XYZ_cloud, color):Takes a 3-tuple as color and adds it to XYZ Point Cloud

  • Return: pcl.PointCloud_PointXYZRGB

rgb_to_float(color):Converts 3-tuple color to a single float32

  • Return: rgb packed as a single float32

get_color_list(cluster_count) : Creates a list of 3-tuple (rgb) with length of the list = cluster_count

  • Return: get_color_list.color_list

코드 다운로드 : wget https://gist.githubusercontent.com/adioshun/f35919c895631314394aa1762c24334c/raw/eb3b6493b964007f3103314e3208a48395f0f973/pcl_helper.py

from pcl_helper import *

color = random_color_gen()
xyzrgb = XYZ_to_XYZRGB(pc, color)

Documentation for pcl_helper.py

pcl_helper.py contains useful functions for working with point cloud data with ROS and PCL. The file itself is located in Exercise-2/sensor_stick/scripts/. While the helper functions are required for Exercise-2, they could also come in handy if you want to explore more deeply in Exercise-1. Here's a brief description of the contents:

Functions:

random_color_gen()

Generates a random set of r,g,b values
Return: a 3-tuple with r,g,b values (range 0-255)

ros_to_pcl(sensor_msgs/PointCloud2)

Converts sensor_msgs/PointCloud2 to XYZRGB Point Cloud
Return: pcl.PointCloud_PointXYZRGB

pcl_to_ros(pcl.PointCloud_PointXYZRGB)

Converts XYZRGB Point Cloud to sensor_msgs/PointCloud2
Return: sensor_msgs/PointCloud2

XYZRGB_to_XYZ(XYZRGB_cloud)

Converts XYZRGB Point Cloud to XYZ Point CLoud
Return: pcl.PointCloud

XYZ_to_XYZRGB(XYZ_cloud, color)

Takes a 3-tuple as color and adds it to XYZ Point Cloud
Return: pcl.PointCloud_PointXYZRGB

rgb_to_float(color)

Converts 3-tuple color to a single float32
Return: rgb packed as a single float32

get_color_list(cluster_count)

Creates a list of 3-tuple (rgb) with length of the list = cluster_count
Return: get_color_list.color_list

github
Code
/get_PCD.py
point_cloud2.py