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

0 commentaires
Réponse acceptée
Hernia Baby
le 5 Oct 2021
Modifié(e) : Hernia Baby
le 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])
3 commentaires
Hernia Baby
le 5 Oct 2021
Modifié(e) : Hernia Baby
le 5 Oct 2021
決まってない場合でもクラスで分かれている時点でindexから抜き出す事が可能と思われます
こちら、やりたい事に近いと思います
X = rand(500, 3);
idx = kmeans(X, 3);
scatter3(X(:,1), X(:,2), X(:,3), 10, idx, 'filled');
hold on
X(idx==2|idx==3,:) = [];
scatter3(X(:,1), X(:,2), X(:,3), 20, 'r');
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur リサンプリングの手法 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!