我有一个 3D 数据矩阵,其中包含有关场景的信息(哪些体素是空闲的/占用的并且属于哪个类)。
到目前为止,为了绘制数据,我必须使用imagesc
.
我想使用 Matlabs 将数据绘制为点云pcshow
,它应该只显示被占用的体素,其余的显示为空白空间。
如何将我的 3D 矩阵转换为点云对象?
对于一些NxMxK矩阵A
,其中A == 255
表示空闲体素:
% make coordinate grid the size of A
[X,Y,Z] = meshgrid(1:size(A,1),1:size(A,2),1:size(A,3));
% move to xyz format
xyz=[X(:) Y(:) Z(:)];
% show points which are not free and where group values are used as color (scaled by to current colormap)
pcshow(xyz(A~=255,:),A(A~=255))
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句