Why do I get an error when I read the color information in the pointCloud struct?

2 ビュー (過去 30 日間)
香露
香露 2025 年 4 月 25 日
編集済み: Shantanu Dixit 2025 年 4 月 28 日
ptColorCloud = pointCloud(all_Cloud, 'Color', uint8(all_labels));
gridStep = 0.05;
ptColorCloud = pcdownsample(ptColorCloud,'gridAverage',gridStep);
ptColorCloudOut = removeInvalidPoints(ptColorCloud);
ptOut = ptColorCloudOut.Location;
colorOut = ptCloudOut.Color;
When I get to the last line of code, I get to the point where I get to the end of the line, I get to say "This type of variable doesn't support indexing with points"

回答 (1 件)

Shantanu Dixit
Shantanu Dixit 2025 年 4 月 28 日
編集済み: Shantanu Dixit 2025 年 4 月 28 日
Hi,
The error seems to be occuring because 'ptCloudOut' is not defined in the code, but is trying to access 'ptCloudOut.Color'. You can use 'ptColorCloudOut.Color' instead, which seems to be the correct variable name containing the point cloud data.
colorOut = ptColorCloudOut.Color;
Hope this helps!

カテゴリ

Help Center および File ExchangeLabeling, Segmentation, and Detection についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by