xyz座標のある点群​データのDSM画像が​作りたいです。解像度​は10㎝程度のものが​作りたいのですが、グ​リッドごとに高さを与​える処理がわかりませ​ん。2000*180​0のグリットシートを​作ろうとしています。

5 views (last 30 days)
tetunari sogabe
tetunari sogabe on 13 Jan 2017
Answered: Tohru Kikawada on 15 Jan 2017
if true
% code
clear;
xsize=200
ysize=180
Xsize = xsize*10;
Ysize = ysize*10;
line = [1:Xsize];
code = [1:Ysize];
[X,Y] = meshgrid(line,code);
[X1,X2] = ndgrid(line,code);
figure()
[X1_ndgrid,X2_ndgrid] = ndgrid(1:Xsize,1:Ysize);
Z = zeros(Xsize,Ysize);
mesh(X1_ndgrid,X2_ndgrid,Z,'EdgeColor','black')
axis equal;
% Set the axis labeling and title
h1 = gca;
h1.XTick = [1:Xsize];
h1.YTick = [1:Ysize];
xlabel('ndgrid Output')
end

Accepted Answer

Tohru Kikawada
Tohru Kikawada on 15 Jan 2017
X,Y,Z座標で構成された3次元の点群データを2Dのメッシュデータにマッピングしたいという内容とお見受けしました。
まずは点群を表面データに変換が必要ですが、 delaunay 関数を使って三角形分割する方法があるかなと思います。
三角形分割されたデータを可視化して、Z軸方向から除くとDSM画像のように可視化することができます。
また、File Exchangeの pointcloud2image がご要望に近そうにも思えます。
ご参考になれば幸いです。
%%3次元点群読込み
load seamount
%%点群の可視化
figure;
scatter3(x,y,z);
%%Z軸方向にDelaunay 三角形分割する例
tri = delaunay(x,y);
figure;
h = trisurf(tri,x,y,z);
h.LineStyle = 'none';
h.FaceColor = 'interp';
xlabel('x');ylabel('y');
view(0,90);
grid off;
colorbar;
点群データの可視化:
三角形分割し、Z軸方向に視点をセット:

More Answers (0)

Categories

Find more on Spatial Search in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!