3d point cloud into voxel grid
Afficher commentaires plus anciens
Hey guys,
i tried to convert a pointcloud of a room created with a laser scanner into a voxel grid, where i can define the size of the voxels like 0.5x0.5x0.5 or even bigger or smaller and then just display all voxels with points from the pointcloud in it.
i tried to use the plotcube.m function in combination with an for loop where i increase the coordinates of the cube like x=0:0.5:18 (where 18 is round about the highst value for x when i plot my pointcloud with scatter3. so i have a loop:
for x=0:0.5:18
for y=0:0.5:35
for z=0:0.5:13
if = 'pointcloudroom.txt' with value
function plotcube (varagin)
end
end
end
but i don't get behind the "if = 'pointcloudroom.txt' with value" part. I tried to extract the values from a matrix with readmatrix but it didn't work.
any suggestions?
2 commentaires
Matt J
le 3 Jan 2022
Please attach sample point cloud data in a .mat file, so that we can demonstrate solutions.
Sven Hecker
le 3 Jan 2022
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 3 Jan 2022
0 votes
In particular, the variable occupied in that code is the binary occupancy grid. The code there also plots the cubes.
The code there is intended to be able to handle different classes and figure out the majority occupancy for any given voxel, and color appropriately. It does indeed figure out the majority occupancy, but as yet I am having trouble with the colorization.
Catégories
En savoir plus sur Lighting, Transparency, and Shading dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
