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

上色效果

相关推荐
winfreedoms1 天前
ubuntu24.04安装numpy时报错error: externally-managed-environment解决办法
numpy
人工小情绪1 天前
python报错:AttributeError: module ‘numpy‘ has no attribute ‘object‘.
python·numpy·neo4j
郑泰科技2 天前
python深度学习报错:Original error was: No module named ‘numpy.core._multiarray_umath‘
python·深度学习·numpy
Java后端的Ai之路2 天前
【Python进阶学习】-NumPy详细介绍指南(附demo)
python·学习·numpy
laplace01232 天前
LangChain 1.0 入门实战 · Part 6:LangChain Agent 中间件(Middleware)入门介绍
笔记·python·中间件·langchain·numpy·pandas
laplace01233 天前
LangChain 1.0 入门实战(Part 1)详细笔记
笔记·python·langchain·numpy·pandas
liu****4 天前
04_Pandas数据分析入门
python·jupyter·数据挖掘·数据分析·numpy·pandas·python常用工具
玄同7654 天前
Python 装饰器:LLM API 的安全与可观测性增强
开发语言·人工智能·python·安全·自然语言处理·numpy·装饰器
adjust25865 天前
day 46
人工智能·机器学习·numpy
渡我白衣5 天前
计算机组成原理(11):加法器
python·机器学习·numpy·pandas·matplotlib·计组·数电