check if a point belongs to a point cloud?

조회 수: 2 (최근 30일)
Giulia Mazzucchelli
Giulia Mazzucchelli 2018년 2월 17일
답변: Rushil 2025년 3월 25일
Hi there,
Is there any method to check if a point belongs to a point cloud? Thanks

답변 (1개)

Rushil
Rushil 2025년 3월 25일
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:

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by