Open3D根据点云高度位置,给点云上色

复制代码
import copy
import time
import open3d as o3d;
import numpy as np;
import matplotlib.pyplot as plt
from scipy.signal import find_peaks
import pandas as pd
import logging
from tqdm import tqdm

colormap = np.random.randint(0,255,(200,3))/255
colormap = np.array([[128, 130, 120], [128, 110, 120], [128, 90, 120], 
                     [235, 0, 205], 
                     [0, 215, 0], 
                     [235, 155, 0]]) / 255.0 

points = np.asarray(pcd_Glue_Begin_End_Pos.points)
points_intensity = points[:, 2]  # intensity 
points_colors = [colormap[int(points_intensity[i]) % colormap.shape[0]] for i in range(points_intensity.shape[0])] 

pcd_Glue_Begin_End_Pos.colors = o3d.utility.Vector3dVector(points_colors)

    o3d.visualization.draw_geometries([pcd_Tire_Glue,pcd_Glue_Begin_End_Pos],window_name="pcd_Tire_Glue ") 

上色效果

相关推荐
家家小迷弟9 小时前
docker容器内部安装python和numpy的方法
python·docker·numpy
蓝眸少年CY12 小时前
Python科学计算 Numpy库
开发语言·python·numpy
谢景行^顾1 天前
numpy
开发语言·python·numpy
咚咚王者5 天前
人工智能之数据分析 numpy:第十三章 工具衔接与迁移
人工智能·数据分析·numpy
咚咚王者5 天前
人工智能之数据分析 numpy:第九章 数组运算(二)
人工智能·数据分析·numpy
咚咚王者6 天前
人工智能之数据分析 numpy:第十二章 数据持久化
人工智能·数据分析·numpy
咚咚王者8 天前
人工智能之数据分析 numpy:第十五章 项目实践
人工智能·数据分析·numpy
咚咚王者11 天前
人工智能之数据分析 numpy:第十章 副本视图
人工智能·数据分析·numpy
咚咚王者11 天前
人工智能之数据分析 numpy:第十一章 字符串与字节交换
人工智能·数据分析·numpy
AI小云12 天前
【数据操作与可视化】Pandas数据处理-Series数据结构
开发语言·数据结构·python·numpy·pandas