Construct voronoi diagram on a point cloud

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 件のコメント

Matt J
Matt J 2025 年 12 月 28 日
編集済み: Matt J 2025 年 12 月 28 日
We do not have the .pcd file, so we cannot run your code or examine the file's contents.
In particular, it is not clear how you would assign 3D point cloud data to 2D voronoi cells. Is the cloud confined to the xy plane in some way?
Saswati
Saswati 2025 年 12 月 28 日
I did not assign 3D point cloud data to 2D voronoi cells. I am looking for the suggestion for how to do that. I can not upload a point cloud file here as the format is unsupported. However, I uploaded a picture of a test poincloud for your reference.
Matt J
Matt J 2025 年 12 月 28 日
編集済み: Matt J 2025 年 12 月 28 日
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?
Saswati
Saswati 2025 年 12 月 28 日
The point cloud has 100,000 points. Each point has a 3D location [X,Y,Z] in meters. X ranges from 0 to 5.59, Y ranges from -10.97 to 0, and Z ranges from 0 to 1. No color or intensity information is associated with the points. For the purpose of calculating the Voronoi diagram, I plan to use the X and Y coordinates as a 2D cloud.

サインインしてコメントする。

 採用された回答

Walter Roberson
Walter Roberson 2025 年 12 月 28 日

0 投票

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.

その他の回答 (1 件)

Matt J
Matt J 2025 年 12 月 28 日
編集済み: Matt J 2025 年 12 月 28 日

0 投票

Using the attached file and this FEX download
you can determine the system of inequalities describing each of the voronoi cells, and then use those to test whether a point from the cloud belongs to the cell.

カテゴリ

ヘルプ センター および File ExchangeVoronoi Diagrams についてさらに検索

製品

タグ

質問済み:

2025 年 12 月 28 日

コメント済み:

2025 年 12 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by