check if a point belongs to a point cloud?
2 views (last 30 days)
Show older comments
Hi there,
Is there any method to check if a point belongs to a point cloud? Thanks
0 Comments
Answers (1)
Rushil
on 25 Mar 2025
Hello
I assume that you are making use of “pointCloud” object from Computer Vision Toolbox. In order to check whether a given point belongs to a point cloud, you can make use of the “findNearestNeighbors” function, which finds the node in the point cloud nearest to the query point. Then check if the distance is less than a certain threshold to determine whether it belongs to the point cloud. Below is implementation for the same:
data = [1, 2, 3; 4, 5, 6; 7, 8, 9]; % some point cloud data
ptCloud = pointCloud(data);
qpt = [4, 5, 6]; % point you want to check (query point)
[idx,dist] = findNearestNeighbors(ptCloud,qpt,1);
threshold = 0.01; % a threshold for "belonging" to the point cloud
isPointInCloud = dist < threshold;
disp(isPointInCloud);
You can read more about “findNearestNeighbors” here:
0 Comments
See Also
Categories
Find more on Point Cloud Processing 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!