check if a point belongs to a point cloud?

2 visualizaciones (últimos 30 días)
Giulia Mazzucchelli
Giulia Mazzucchelli el 17 de Feb. de 2018
Respondida: Rushil el 25 de Mzo. de 2025
Hi there,
Is there any method to check if a point belongs to a point cloud? Thanks

Respuestas (1)

Rushil
Rushil el 25 de Mzo. de 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:

Categorías

Más información sobre Point Cloud Processing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by