Construct voronoi diagram on a point cloud
43 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Saswati
am 28 Dez. 2025 um 17:43
Kommentiert: Saswati
am 28 Dez. 2025 um 21:01
I have a point cloud file in the .pcd format. I want to calculate a Voronoi diagram for this .pcd file. I also have a set of points with x and y coordinates that were extracted from the .pcd file. I want to calculate the Voronoi diagram based on these x and y coordinates. My objective is to divide the point cloud into zones corresponding to these points (x, y). So far, I have written the following code but it seems like there is no connection between the point cloud and x-y coordinates. How can I relate the point cloud and the co ordinates?
ptCloud = pcread("test_obj6.pcd");
x = [ 7.0267 4.8436 4.8767 2.8000];
y = [ 4.2001 4.5947 2.1412 3.2000];
voronoi(x,y)
4 Kommentare
Matt J
am 28 Dez. 2025 um 18:28
Bearbeitet: Matt J
am 28 Dez. 2025 um 18:34
I did not assign 3D point cloud data to 2D voronoi cells. I am looking for the suggestion for how to do that.
But the notion of what it means to do that is not obvious. You need to specify that for us. Your attached .png file does not appear to be a cloud of 3D points. It appears to be a 2D image. Are the pixels meant to be seen as locations in a 2D cloud? What does the color coding mean?
Akzeptierte Antwort
Walter Roberson
am 28 Dez. 2025 um 19:22
Use something like pca() to determine the major axes for the data. Rotate the data so that the major axes becomes the xy plane. Drop the z axes and run voronoi on the result.
There is code that uses svd() instead of pca(); see https://www.mathworks.com/matlabcentral/answers/1735650-how-can-the-major-axis-of-a-3d-object-be-determined#answer_986490
0 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Voronoi Diagram finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!