detect the centerline of 3D data points

8 ビュー (過去 30 日間)
Penny
Penny 2017 年 12 月 8 日
コメント済み: ng 2019 年 8 月 20 日
Hello, everyone. I am trying to detect the centerline of a set of 3D points. These 3D points are plotted and the figure is attached.
Does anybody know how to detect the centerline of these 3D data points. The equation of this centerline may be z = k1*x+k2*y+b; The coordinates of the 3D points are stored in X, Y, Z.
  3 件のコメント
Matt J
Matt J 2017 年 12 月 8 日
Do the points lie on the surface of a circular cylinder, or some more general surface?
Penny
Penny 2017 年 12 月 8 日
Yes, the points lie on the surface of a circular cylinder. But not a regular cylinder

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

採用された回答

Matt J
Matt J 2017 年 12 月 8 日
編集済み: Matt J 2017 年 12 月 8 日
If the parametric equations for the line is L(t)=m+t*d, the following should give a good estimate of m and d, as long as the sampling of the surface is uniformly distributed,
A=[X(:),Y(:),Z(:)];
m=mean(A,1).';
A=A-m.';
[~,~,V]=svd(A,0);
d=V(:,1);
  8 件のコメント
Matt J
Matt J 2019 年 8 月 20 日
編集済み: Matt J 2019 年 8 月 20 日
I am beginning to think it could be because the top and bottom edges of the cylinder are not perpendicular to the expected axis which is why there is the slight angle.
That would definitely contribute, but even more generally than that, we don't expect exact results when fitting noisy data.
ng
ng 2019 年 8 月 20 日
That is a fair point. Thank you for taking a look.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by