3次元点群の法線ベクトルをもとめる
Show older comments
3次元点群の任意点(point)に対して
・法線ベクトルとその単位ベクトルを求めたいです
・求めた近似平面と法線ベクトルを可視化(グラフ表示)したいです
どのようにするとよろしいでしょうか
%任意点とその半径から捜査範囲を設定
ptCloud=pcread('airplane.ply');%サンプルデータ参照元https://people.sc.fsu.edu/~jburkardt/data/ply/ply.html
point = [901.47 34.53 64.99]; radius = 10;
[indices,dists] = findNeighborsInRadius(ptCloud,point,radius);
ptCloudB = select(ptCloud,indices);
X=ptCloudB.Location;
%参考:主成分分析を使用した直交回帰の近似 - MATLAB & Simulink Example - MathWorks 日本
[coeff,score,roots] = pca(X);
normal = coeff(:,3) %近似平面の法線ベクトル
%%以降に可視化するコードを書きたい
Accepted Answer
More Answers (0)
Categories
Find more on LIDAR および点群の処理 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!