필터 지우기
필터 지우기

Turn a X Y Z matrix into a point cloud

조회 수: 59 (최근 30일)
Sushmitha Kudari
Sushmitha Kudari 2020년 2월 21일
댓글: Adam Danz 2021년 1월 12일
I have a matrix as follows for example where the first column is X coordinate, second column is the Y coordinate and third column is the Z coordinate. How can i turn this matrix into a point cloud with pcwrite and pcshow? It has to be in a point cloud format.
[1 8 9; 2 3 4; 9 8 6]
  댓글 수: 1
Adam Danz
Adam Danz 2021년 1월 12일
xyz = [1 8 9; 2 3 4; 9 8 6];
ptCloud = pointCloud(xyz)
ptCloud =
pointCloud with properties: Location: [3×3 double] Count: 3 XLimits: [1 9] YLimits: [3 8] ZLimits: [4 9] Color: [] Normal: [] Intensity: []
pcshow(ptCloud,'MarkerSize',1000)

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

답변 (3개)

Image Analyst
Image Analyst 2020년 2월 21일
Try
plot3(x, y, z);
or
scatter3(x, y, z);
or, if you have a surface rather than a cloud
surf(x, y, z);
  댓글 수: 2
Sushmitha Kudari
Sushmitha Kudari 2020년 2월 21일
I have to have it in a point cloud format for when I export it.
Image Analyst
Image Analyst 2020년 2월 22일
I never heard of it but I guess Hiroki has and it seems there is a function to put it into that class. Then you can export it somehow, like using save() to put it into a .mat file. What program are you exporting it for? What program will use this data that you exported? Does that program know how to read in .mat files? If not, what formats does that program know about?

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


the cyclist
the cyclist 2020년 2월 21일
xyzPoints = [1 8 9; 2 3 4; 9 8 6];
ptCloud = pointCloud(xyzPoints);
  댓글 수: 3
Hiroki Okawa
Hiroki Okawa 2020년 2월 21일
can you please show the error messages?
Sushmitha Kudari
Sushmitha Kudari 2020년 2월 21일
There is no error message but the plot is a linear line which is incorrect. It is supposed to be topography map.

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


Hiroki Okawa
Hiroki Okawa 2020년 2월 21일
편집: Hiroki Okawa 2020년 2월 21일
I think that pcshow function will woks
pcshow([1 8 9; 2 3 4; 9 8 6])
By the way, you can convert xyz matrix into point cloud format by pointCloud function
ptCloud = pointCloud(xyzPoints)
in this case,
ptCloud = pointCloud([1 8 9; 2 3 4; 9 8 6])

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by