Files
massive-cloud/alg/point_porj/archive/relative_code/FPFH.py

16 lines
442 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import open3d as o3d
import numpy as np
pcd = o3d.io.read_point_cloud("pointcloud.pcd")
# 1. 计算法线
pcd.estimate_normals(search_param=o3d.geometry.KDTreeSearchParamKNN(k=30))
# 2. 提取FPFH特征
fpfh = o3d.pipelines.registration.compute_fpfh_feature(
pcd,
o3d.geometry.KDTreeSearchParamKNN(k=50)
)
# fpfh.data 是 (33, N) 的矩阵,每列是一个点的33维FPFH描述子
print(fpfh.data.shape) # (33, N)