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

Matt J
Matt J 2022년 1월 3일
Please attach sample point cloud data in a .mat file, so that we can demonstrate solutions.
Sven Hecker
Sven Hecker 2022년 1월 3일
i attched the pointcloudroom.txt :)

댓글을 달려면 로그인하십시오.

 채택된 답변

Matt J
Matt J 2022년 1월 3일
편집: Matt J 2022년 1월 3일

1 개 추천

load data
voxelsize=0.5;
for i=1:3
tmp=xyz(:,i);
edges=min(tmp):voxelsize:max(tmp)+voxelsize;
xyz(:,i)=discretize( tmp , edges);
end
V=accumarray(xyz,1)>0;
volumeViewer(V);

댓글 수: 8

Sven Hecker
Sven Hecker 2022년 1월 3일
thank you,
but this is what i get when i try to run this. I named it voxeliz.
>> voxeliz
Error using images.internal.app.volview.checkOpenGLDrivers
Windows Software OpenGL support does not meet the minimum requirement of this app. Try executing the command
"opengl hardware". Type "doc opengl" for more information.
Error in images.internal.app.volview.VolumeViewer/setupApp
Error in images.internal.app.volview.VolumeViewer
Error in volumeViewer (line 61)
images.internal.app.volview.VolumeViewer(varargin{:});
Error in voxeliz (line 9)
volumeViewer(V);
Sven Hecker
Sven Hecker 2022년 1월 3일
seems like my MATLAB or hardware isn't made for this, is it?
Matt J
Matt J 2022년 1월 3일
You should do as the error message advises. Use "opengl hardware".
Sven Hecker
Sven Hecker 2022년 1월 3일
i did. but then i get the warning: Unable to select hardware OpenGL rendering.
Matt J
Matt J 2022년 1월 3일
It seems your graphics hardware doesn't have OPENGL. However, the volume V has been computed sucessfully. You can use whatever alternative viewing app you wish to inspect it.
Sven Hecker
Sven Hecker 2022년 1월 3일
Yeah, I tried imshow already and could inspect the different layer (that's what it seems like). Thank you very much for your help!!!
Walter Roberson
Walter Roberson 2022년 1월 3일
Windows Software OpenGL support does not meet the minimum requirement of this app.
That message can occur when you use remote access such as Terminal Services to a Windows machine, or when you run Windows in a Virtual Machine (I think).
Sven Hecker
Sven Hecker 2022년 1월 4일
oh, yes I'm using remote access to my university account....

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2022년 1월 3일

0 개 추천

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.

카테고리

질문:

2022년 1월 3일

댓글:

2022년 1월 4일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by