3D Point Cloud - Gaussian Curvature
조회 수: 52 (최근 30일)
이전 댓글 표시
Hello All.
I have a 3D point cloud data (X [m]; Y[m]; Z[m]). And I want to calculate the value of some curvature (e.g. gaussian) in every point of the point cloud. Based on these curvature information I would select the points, that may belong to some geometric shape in the point cloud (e. g. to some planes, spheres etc.).
Is there a built in function for it in Matlab, like normals() for normal vector estimation? Or does anyone know a way how to do this? It should be fast and dont need to be really precise, because it is only a pre-processing step.
Thanks in Advance,
Richard
댓글 수: 0
채택된 답변
darova
2019년 11월 26일
one way
clc,clear
% generate some data
r = 3;
t = linspace(0,10)';
x = r*cos(t);
y = r*sin(t);
z = sin(1*t);
t1 = t(2:end) - diff(t)/2;
dv = diff([x y z])./diff([t t t]); % first derivative at midpoints
d2v= diff(dv)./diff([t1 t1 t1]); % second derivative at points [2:end-1]
dv = 1/2*( dv(1:end-1,:) + dv(2:end,:) );% first derivative at points [2:end-1]
[dx,dy,dz] = deal( dv(:,1),dv(:,2),dv(:,3) );
[d2x,d2y,d2z] = deal( d2v(:,1),d2v(:,2),d2v(:,3) );
% curvature
kk = (d2z.*dy - d2y.*dz).^2 + (d2x.*dz - d2z.*dx).^2 + (d2y.*dx - d2x.*dy).^2;
kk = sqrt(kk) ./ (dx.^2+dy.^2+dz.^2).^(3/2);
% radius
RR1 = 1./kk;
plot(t(2:end-1),RR1)
댓글 수: 10
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Point Cloud Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!