Clustering of point clouds into cells and perform loop over several files and finally display

3 visualizzazioni (ultimi 30 giorni)
Hello everyone!
I have 5 files of point clouds at different time instants. I have divided the point cloud into different cells by using DBSCAN algorithm but one cells always remain empty. For example The total number of points are 26000 approx, as a result it has been divided into cells such as 20000 but one cells is empty with missing points. I am attaching the code of it. Could anyone please help me in this.
My second question is that, how i perform loop over several point clouds. Here, I am attaching some of the point clouds files in text format.
Any help will be appreciated.
thanks

Risposta accettata

Ashu
Ashu il 20 Mar 2023
Hi Adnan
Query 1:
I understand that you are getting an empty cell while selecting points for each cluster.
In your code for 'Selecting Points for Each Cluster'
node_values = cell(1,numGroups);
for i = 1:numGroups
b= X(labels==i-1,:); % <-- to correct: there is no cluster with label 0
node_values{1, i} = b;
end
for i = 1,
b= X(labels==i-1,:);
returns an empty cell which means that there is no cluster with label 0. This is an expected behaviour according to your code and it reflects in the plot for the DBSCAN.
According to my understanding you want to skip labels with value 0 in the node_values. To do that you can just refractor your code as follows:
node_values{1,1} =X(labels==-1,:); % handling -1 labels and avoiding empty cells for zero labels
for i = 1:numGroups-1 % i goes from 1 to 10 for the fact that labels from 1 to 10 exist
b= X(labels==i,:);
node_values{1, i+1} = b;
end
Query 2:
You can simply put all the current code in a function and call it for other point clouds.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by