主要内容

本页采用了机器翻译。点击此处可查看英文原文。

removeInvalidPoints

从点云中移除无效点

说明

[ptCloudOut,indices] = removeInvalidPoints(ptCloud) 会从点云中移除坐标值为 InfNaN 的点,并返回有效点的索引。

注意

输出结果始终是一个无序的 (X×3) 点云。如果输入 ptCloud 是一个有序点云 (M×N×3),则该函数将输出一个无序点云。

示例

示例

全部折叠

使用 NaNInf 的值创建一个点云对象。

xyzpoints = abs(randn(10,3)).*100;
xyzpoints(1:2:4,:) = nan('single');
xyzpoints(6:2:10,:) = inf('single');
ptCloud = pointCloud(xyzpoints);

检查点云数据的 Location 属性,以验证是否存在 NaNInf 值。

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

从点云中移除值为 NaNInf 的点。

ptCloudOut = removeInvalidPoints(ptCloud);

检查点云数据的 Location 属性,以确认无效点已被移除。

ptCloudOut.Location
ans = 5×3

  183.3885  303.4923  120.7487
   86.2173    6.3055  163.0235
   31.8765   71.4743   48.8894
   43.3592   12.4144   72.6885
  357.8397  140.9034   29.3871

输入参数

全部折叠

点云,指定为 pointCloud 对象。

输出参量

全部折叠

点云,以 pointCloud 对象的形式返回,其中已移除 InfNaN 坐标。

注意

输出结果始终是一个无序的 (X×3) 点云。如果输入 ptCloud 是一个有序点云 (M×N×3),则该函数将输出一个无序点云。

点云中有效点的索引,指定为一个向量。

扩展功能

全部展开

C/C++ 代码生成
使用 MATLAB® Coder™ 生成 C 代码和 C++ 代码。

GPU 代码生成
使用 GPU Coder™ 为 NVIDIA® GPU 生成 CUDA® 代码。

版本历史记录

在 R2015a 中推出

另请参阅

|