[ptCloudOut,indices] = removeInvalidPoints(ptCloud)
removes points with Inf or NaN coordinate values from
point cloud and returns the indices of valid points.
Inspect the Location property of point cloud data to verify the occurrence of NaN and Inf values.
ptCloud.Location
ans = 10×3
NaN NaN NaN
183.3885 303.4923 120.7487
NaN NaN NaN
86.2173 6.3055 163.0235
31.8765 71.4743 48.8894
Inf Inf Inf
43.3592 12.4144 72.6885
Inf Inf Inf
357.8397 140.9034 29.3871
Inf Inf Inf
Remove points with NaN and Inf values from the point cloud.
ptCloudOut = removeInvalidPoints(ptCloud);
Inspect the Location property of point cloud data to verify that the invalid points are removed.
ptCloudOut — Point cloud with points removed pointCloud object
Point cloud, returned as a pointCloud object with
Inf or NaN coordinates removed.
Note
The output is always an unorganized (X-by-3) point cloud. If
the input ptCloud is an organized point cloud
(M-by-N-by-3), the function returns the
output as an unorganized point cloud.
indices — Indices of valid points vector
Indices of valid points in the point cloud, specified as a vector.
Extended Capabilities
C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.
GPU Code Generation Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.