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 ") 

上色效果

相关推荐
元Y亨H9 小时前
numpy与pandas 的介绍
numpy·pandas
广州景颐光电7 天前
3种NumPy向量化实测:光源数据处理从2.3秒压到12.3ms
numpy
梅雅达编程笔记8 天前
零基础学 Python 第14章 | 模块、包与第三方库
开发语言·python·django·numpy·pandas
梅雅达编程笔记8 天前
零基础学 Python 第15章 | 类与对象:面向对象编程入门
开发语言·python·django·numpy·pandas
pulinzt8 天前
Tableau的基础使用
数据库·numpy
梅雅达编程笔记9 天前
编程启蒙|Scratch 转 Python 系列第9天:字典/哈希表积木双向对照(AI大模型参数配置表实战)
开发语言·人工智能·python·numpy·pandas
汤姆小白11 天前
08-应用部署
人工智能·python·机器学习·numpy·transformer
汤姆小白13 天前
02-Tokenizer原理与实现
人工智能·python·机器学习·numpy
汤姆小白13 天前
01-环境搭建与项目导览
人工智能·python·机器学习·numpy
CS创新实验室14 天前
NumPy数组的C风格和Fortran风格
c语言·开发语言·numpy