Exclude some nodes from a 3D point cloud (select only neighboring nodes)
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Alberto Acri
el 11 de Mayo de 2023
Hi! I would need code to create a matrix of nodes excluding those circled in red. Is there any code that I could use?
I would need a code where, for example, I select a node I am interested in and it automatically selects all neighboring nodes (within a certain distance x,y,z).
selection = importdata("selection.mat");
figure
plot3(selection(:,1),selection(:,2),selection(:,3),'b.','Markersize',5)
grid on
hold on
axis equal
xlabel('x')
ylabel('y')
zlabel('z')
0 comentarios
Respuesta aceptada
Matt J
el 13 de Mayo de 2023
Editada: Matt J
el 13 de Mayo de 2023
X=load('selection').selection; %shorten data name
G=graph(pdist2(X,X)<=10);
T=conncomp(G);
[~,i]=max(histcounts(T,[unique(T),inf]));
I=T==i;
plot3(X(I,1),X(I,2),X(I,3),'b.','Markersize',5); hold on
plot3(X(~I,1),X(~I,2),X(~I,3),'r.','Markersize',5); hold off
grid on
axis equal
xlabel('x'),ylabel('y'),zlabel('z')
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Point Cloud Processing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!