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

上色效果

相关推荐
黎明沐白2 天前
PyTorch源码编译报错“fatal error: numpy/arrayobject.h: No such file or directory”
人工智能·pytorch·numpy
NorthFish北海有鱼2 天前
python三维矩阵的维度
python·矩阵·numpy
浅浅2804 天前
numpy、pandas内存优化操作整理
数据结构·经验分享·python·学习·性能优化·numpy·pandas
帮帮志4 天前
07.Python代码NumPy-排序sort,argsort,lexsort
numpy
秋凉花落4 天前
课堂总结。
numpy
架构师那点事儿4 天前
人工智能基础-NumPy-向量矩阵数组库
人工智能·python·numpy
跟着杰哥学Python5 天前
一文读懂Python之numpy模块(34)
开发语言·python·numpy
热爱编程的OP9 天前
Numpy常用库方法总结
开发语言·python·numpy
ljd21032312412 天前
numpy练习
numpy
满怀101512 天前
【NumPy科学计算引擎:从基础操作到高性能实践】
开发语言·python·numpy