Plane fitting using 3D points

105 ビュー (過去 30 日間)
Ashicka Banu Mubarak
Ashicka Banu Mubarak 2019 年 3 月 26 日
コメント済み: VIGNESH BALAJI 2023 年 7 月 21 日
I have my 3D points(lidar data) as a text file. can anyone suggest me a method for fitting the plane.

採用された回答

Star Strider
Star Strider 2019 年 3 月 26 日
Try this:
P = bsxfun(@times, rand(49, 3), [1 10 100]); % Create Matrix [x, y, z]
B = [P(:,1), P(:,2), ones(size(P,1),1)] \ P(:,3); % Linear Regression
xv = [min(P(:,1)) max(P(:,1))];
yv = [min(P(:,2)) max(P(:,2))];
zv = [xv(:), yv(:), ones(2,1)] * B; % Calculate Regression Plane
figure
stem3(P(:,1), P(:,2), P(:,3), '.')
hold on
patch([min(xv) min(xv) max(xv) max(xv)], [min(yv) max(yv) max(yv) min(yv)], [min(zv) min(zv) max(zv) max(zv)], 'r', 'FaceAlpha',0.5)
hold off
grid on
xlabel('X')
ylabel('Y')
producing (with this set of random data):
Plane fitting using 3D points - 2019 03 26.png
  7 件のコメント
Ashicka Banu Mubarak
Ashicka Banu Mubarak 2019 年 3 月 28 日
Orthoimage
VIGNESH BALAJI
VIGNESH BALAJI 2023 年 7 月 21 日
@Star Strider When I use your method, the plane fit for a 3D dataset is not a good fit, maybe because instead of regression you can calculate mean of the points and find a basis of the plane and fit the plane to the data.
When I used Plane Fit (Affine fit function to fit the data) https://nl.mathworks.com/matlabcentral/fileexchange/43305-plane-fit . I got a better fit

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by