Plane fitting using PCA or princomp

4 次查看(过去 30 天)
Sharif
Sharif 2013-7-4
hi i am trying to a fit plane to point clouds (x y z coordinates) to work out the orientation (of the points) based on the normal of the plane and the direction cosine to the Z axis (0 0 1)
i have a few thousand of these 'cluster' of points.
i find that the direction cosine (from [0 0 1]) of the normals are between 0 and 135 degrees as opposed to between 0 and 180 degrees . i have tried a variety of datasets showing the same anomaly. when i checked the minimum and maximum of the of the normal vectors matrix i found them to be [-0.7071 -0.7071 -0.7071] and [1 1 1] instead of +-[1 1 1].
does anyone have clue as to why this is happening?
I under that impression that PCA rotates and centers the points prior to fitting. does this mean i need to apply a transform on the normals?
Please help! thanks, S
plane fitting code:-
% do fit [coeff,score,roots] = pca(data);
% Get unit normal of fitted plane pc_normal(i,:) = coeff(:,3)'; %fill with normal vector
% calculate direction cosine from Z (vertical) axis pc_rads(i,1) = acos(dot(pc_normal(i,:), [0 0 1]));

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dimensionality Reduction and Feature Extraction 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by