跳到主要内容

PassThrough

https://pointclouds.org/documentation/classpcl_1_1_pass_through.html

遍历整个输入一次,自动过滤非有限点和 setFilterLimits() 指定的区间之外的点,这仅适用于 setFilterFieldName() 指定的字段。

Constructor​

new PCL.PassThrough(removed, pointType);

示例:

import * as PCL from 'pcl.js';

await PCL.init();

new PCL.PassThrough(PCL.PointXYZ, true);

参数:

名称类型默认值描述
pointTypePointTypePointXYZThe point cloud type.
extractRemovedIndicesbooleanfalseInitializing with true will allow us to extract the removed indices.

方法​

setFilterFieldName()​

setFilterFieldName(fieldName);

提供要用于过滤数据的字段的名称。 与 setFilterLimits() 结合使用,该字段的值超出此区间的点将被丢弃。

参数:

名称类型默认值描述
fieldNamestringPath to the blog content directory on the file system, relative to site dir.

getFilterFieldName()​

getFilterFieldName();

返回:

类型描述
stringPath to the blog content directory on the file system, relative to site dir.

setFilterLimits()​

setFilterLimits(min, max);

为过滤数据的字段设置数值限制。 与 setFilterFieldName() 结合使用,该字段的值超出此区间的点将被丢弃。

参数:

名称类型默认值描述
minnumber0Path to the blog content directory on the file system, relative to site dir.
maxnumber0Path to the blog content directory on the file system, relative to site dir.

getFilterLimits()​

getFilterLimits();

返回:

名称类型
limitsFilterLimits

setNegative​

setNegative(negative);

设置是应用点过滤的常规条件,还是应用倒置条件。

参数:

名称类型默认值描述
negativebooleanfalsefalse: normal filter behavior, true: inverted behavior.

getNegative​

getNegative();

setKeepOrganized​

setKeepOrganized(keepOrganized);

设置过滤后的点是否应保留并设置为通过 setUserFilterValue 给出的值(默认值:NaN),或者从 PointCloud 中删除,从而可能破坏其组织结构。

参数:

名称类型默认值描述
keepOrganizedbooleanfalsefalse: remove points, true: redefine points, keep structure.

getKeepOrganized​

getKeepOrganized(keepOrganized);

setUserFilterValue​

setUserFilterValue(value);

提供一个值,过滤点应设置为而不是删除它们。

与setKeepOrganized()一起使用。

参数:

名称类型默认值描述
valuenumbernullnullThe user given value that the filtered point dimensions should be set to.

setInputCloud​

setInputCloud(cloud);

参数:

名称类型默认值描述
cloudPointCloudThe point cloud data message

getInputCloud​

getInputCloud();

返回:

名称类型描述
cloudPointCloudThe point cloud data message

filter​

filter(cloud);

参数:

名称类型默认值描述
cloud (optional)PointCloudThe point cloud data message

返回:

名称类型描述
cloudPointCloudThe point cloud data message

类型定义​

FilterLimits​

interface FilterLimits {
min: number;
max: number;
}