# farthest_point_sample函数完成最远点采样:
# 从一个输入点云中按照所需要的点的个数npoint采样出足够多的点,
# 并且点与点之间的距离要足够远。
# 返回结果是npoint个采样点在原始点云中的索引。
def farthest_point_sample(xyz, npoint):
"""
Input:
xyz: pointcloud data, [B, N, 3]
npoint: number of samples
Return:
centroids: sampled pointcloud index, [B, npoint]
"""
device = xyz.device
B, N, C = xyz.shape
# 初始化一个centroids矩阵,用于存储npoint个采样点的索引位置,大小为B×npoint
# 其中B为BatchSize的个数
centroids = torch.ze
计算机视觉知识点整理:PointNet++之最远点采样(farthest point sample, FPS)代码理解
最新推荐文章于 2025-03-31 15:48:01 发布