Draw a plane over 3d point cloud and determine the 3d point above or below that plane ?

조회 수: 2 (최근 30일)
Dear sir/ Madam
I have a 3d pont cloud in which let N are the no of points. Every point has X, Y and Z coordinate.
I want to draw a plane over this 3d point cloud which intersects this point cloud.
Next step is to determine the indices of points which are lying below or above that plane.
Please help me.
Thanks

채택된 답변

Matt J
Matt J 2018년 11월 26일
편집: Matt J 2018년 11월 26일
I would start with this,
P=[X(:),Y(:),Z(:)];
p=mean(P,1);
[~,~,V]=svd( P-p,0);
planeNormal=V(:,end);
planeEquation=[planeNormal;-dot(planeNormal,p(:))];
  댓글 수: 6
Arvind Kumar Pathak
Arvind Kumar Pathak 2018년 11월 26일
Dear sir
Thanks for your help. I am new for matlab environment, but I have tried this one.
But I am not able to understand it completely
P=[radius(:,1),radius(:,2),radius(:,3)];
p=mean(P,1);
% [~,~,V]=svd(P-p,0);
[~,~,V]=svd( bsxfun(@minus,P,p) , 0);
planeNormal=V(:,end);
planeEquation=[planeNormal;-dot(planeNormal,p(:))];
hold on
[xx, yy]=meshgrid(0:0.1:1,0:0.1:1); % Generating a regular grid for plotting
zz = planeEquation(1,1) * xx + planeEquation(2,1) * yy + planeEquation(3,1);
surf(xx,yy,zz) % Plotting the surface
Please guide me
Matt J
Matt J 2018년 11월 26일
편집: Matt J 2018년 11월 26일
Thanks for your help. I am new for matlab environment
Hardly. You have been using Matlab for at least a year and a half, according to your posting history.
However, I advise you to start with this change
zz = (planeEquation(1)*xx + planeEquation(2)*yy + planeEquation(4) )./(-planeEquation(3));

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by