3次元点群から外れ値を除去
12 views (last 30 days)
Show older comments
こんにちは。地理座標系(緯度[deg]、経度[deg]、高さ[m])のデータから、scatter3で3次元図にしたデータがあります。
以下写真のように、赤丸で囲まれた外れ値を除去したいのですが、なにか良い方法はありますでしょうか?
以下の記事を見たのですが、地理座標系には対応していないようでした。
https://jp.mathworks.com/help/vision/ref/pcdenoise.html
よろしくお願いいたします。

0 Comments
Accepted Answer
Hernia Baby
on 5 Oct 2021
Edited: Hernia Baby
on 5 Oct 2021
外れ値がわかるのでしたらindexを活用するのはいかがでしょうか?
figure
[X,Y,Z] = sphere(16);
x = [0.5*X(:); 0.75*X(:); X(:)];
y = [0.5*Y(:); 0.75*Y(:); Y(:)];
z = [0.5*Z(:); 0.75*Z(:); Z(:)];
scatter3(x,y,z,'k.')
hold on
ここでx,y,zが正のものだけを取り出します
そして赤色で囲みます
idx = x > 0 & y >0 & z>0;
x1 = x(idx);
y1 = y(idx);
z1 = z(idx);
scatter3(x,y,z,'r')
赤色を外れ値として扱う場合、その部分を削除します
該当部分を青で囲みます
x2 = x; y2 = y; z2 = z;
x2(idx) = [];
y2(idx) = [];
z2(idx) = [];
scatter3(x2,y2,z2,'b')
xlim([-1 1])
More Answers (0)
See Also
Categories
Find more on Matrix Indexing 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!