Pointnet++ issue"Index exceeds the number of array elements. Index must not exceed 0. Error in helperNormalizePointCloud (line 16)"
3 views (last 30 days)
Show older comments
Hi!
Can someone help me with this? I am trying to performe task "Segment Aerial Point Cloud" from example "AerialLidarSemanticSegmentationUsingPointNetExample". I use a model I trained my own data, then I tried to test the trained model back to my data. However, I encounter the problem "Index exceeds the number of array elements. Index must not exceed 0. Error in helperNormalizePointCloud (line 16)".
0 Comments
Accepted Answer
Sai Pavan
on 28 Nov 2023
Hi Ziyuan,
I understand that you are trying to resolve the index error raised in ‘helperNormalizePointCloud’ function when testing the semantic segmentation model on a test point cloud taken from a custom dataset.
The ‘helperNormalizePointCloud’ function is used in the example to normalize the point cloud, such that X-Limits, Y-Limits and Z-Limits of the point cloud are in the range [0,1]. The function creates an array ‘xyzMin’ in line 16, which contains the minimum range of coordinates of the point cloud in each axis, computed with the help of ‘XLimits’, ‘YLimits’ and ‘ZLimits’ properties. However, the “index exceed number of array elements” error is occurring here as it appears that the test point cloud may lack 1 or more dimensions resulting in the range properties giving out empty vectors.
The error can be verified by checking if the point cloud contains any values in the X, Y and Z axes using ‘XLimits’, ‘YLimits’ and ‘ZLimits’ properties. If one of them returns an empty vector, then it verifies that the point cloud does not contain 3-dimensional data. The error can be resolved by testing the model on point clouds which certainly have 3D data.
Please refer to the below documentation to learn more about ‘XLimits’, ‘YLimits’, ‘ZLimits’ and other properties of a point cloud object: https://www.mathworks.com/help/vision/ref/pointcloud.html?searchHighlight=ptcloud.XLimits&s_tid=srchtitle_support_results_1_ptcloud.XLimits#:~:text=cloud%0ApointCloud%20object-,Properties,-expand%20all
Hope it helps.
Regards,
Sai Pavan
More Answers (0)
See Also
Categories
Find more on Labeling, Segmentation, and Detection in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!