pcdistance
Syntax
Description
Point-to-Point Distance
returns Euclidean distances between each point in the target point cloud
dists = pcdistance(targetPtCloud,referencePtCloud)targetPtCloud and its closest point in the reference point cloud
referencePtCloud.
[
additionally returns the linear indices of the closest points in the
reference point cloud for each point in the target point cloud.dists,indices] = pcdistance(targetPtCloud,referencePtCloud)
Point-to-Plane Distance
[
returns distances between each point in the target point cloud and corresponding plane
estimated from the reference point cloud. For each point in the target point cloud, the
function first finds the closest point in the reference point cloud using Euclidean
distance. It then finds six nearest neighbors of this closest point to estimate a
corresponding plane. Finally, the function computes the perpendicular distance from the
target point to the estimated plane.dists,indices] = pcdistance(targetPtCloud,referencePtCloud,"pointToPlane")
The function also returns the linear indices of the closest points in the reference point cloud for each point in the target point cloud.
[
specifies the number of nearest neighbors in the reference point cloud to use to fit a
plane. dists,indices] = pcdistance(targetPtCloud,referencePtCloud,"pointToPlane",NumNeighbors=numNeighbors)
Note
The function expects that the target and reference point clouds are aligned with each other.
The distance output values are not symmetric. You must carefully define input point clouds as the target and reference point clouds.
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2026a


