How to rotate or align point cloud ?
古いコメントを表示
Excuse me everyone! I have point cloud as shown in the figure. I want to rotate to the horizontal plane. The rotation point is the middle. How can I do it ? Thank you very much.

採用された回答
その他の回答 (1 件)
Image Analyst
2021 年 12 月 25 日
You forgot to attach your data, which would have made it easier.
So I'd guess at something like
% Fit a line through the data.
coefficients = polyfit(x, y, 1);
% Then get the mean y
meany = mean(y);
% Get a fitted y
fittedy = polyval(coefficients, x);
% Then subtract the fitted values and add the vertical offset.
rotatedy = y - fittedy + meany;
plot(x, rotatedy, '.', 'MarkerSize', 10);
9 件のコメント
Lyhour Chhay
2021 年 12 月 25 日
編集済み: Lyhour Chhay
2021 年 12 月 25 日
Image Analyst
2021 年 12 月 25 日
I'm not going to type all that in. Did you try my code? If not, why not?
You can attach the variable in a .mat file
save('answers.mat', 'plyRoi');
if you still need help.
Lyhour Chhay
2021 年 12 月 25 日
Image Analyst
2021 年 12 月 25 日
編集済み: Image Analyst
2021 年 12 月 25 日
In that data, which N-by-3 matrix is actually the xyz data? Location? Normal?

Lyhour Chhay
2021 年 12 月 25 日
Image Analyst
2021 年 12 月 25 日
Once all the data is plotted, I can see it's more like a plane. I think you're best off fitting it to a plane like Matt says, then find the normal to the fitted plane values and use that to rotate the point cloud to flatten/level it.
Lyhour Chhay
2021 年 12 月 25 日
Image Analyst
2021 年 12 月 25 日
Well give him time - it is Christmas Day after all. 🎅
Lyhour Chhay
2021 年 12 月 26 日
カテゴリ
ヘルプ センター および File Exchange で Data Distribution Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






