简体   繁体   中英

Unable to find functionality to add specific colour to PPTK pointcloud

I have a segmented point cloud, with labels corresponding to each set of coordinates. I would like to visualize the point cloud in pptk such that the points correspond to certain colours associated with their labels. I couldn't find any efficient way to make this happen - the best I found was this https://heremaps.github.io/pptk/tutorials/viewer/semantic3d.html but it doesn't quite cut it because it seems like a different type of file format would have to be made. I would appreciate any help.

if I understand you correctly you want to colour a point cloud according to each points class. In case of 100 points and 5 classes this should do the trick:

xyz = np.random.rand(100, 3) # points [N,3]
xyz_class = np.random.randint(0, 5, 100) # per point class [N]
rgb = np.random.rand(5, 3) # 5 colours

xyz_rgb = rgb[xyz_class, :]
pptk.viewer(xyz, xyz_rgb)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM