Open3D API
[TOC]
Open3D demo
文件读取
PointCloud:
- 1 文件读取
- 2 数组数据读取
1 | print("Testing IO for point cloud ...") |
1 | source = o3d.io.read_point_cloud("../TestData/ICP/cloud_bin_0.pcd") |
TriMesh:
1 | print("Testing IO for meshes ...") |
Image:
1 | print("Testing IO for textured meshes ...") |
TriMesh to PointCloud v1
triMesh完全PointCloud读取
1 | def load_ply_point_cloud(filename,voxel_size=0.5): |
TriMesh to PointCloud v2
采样的方式,进行采用PointCloud
sample_points_poisson_disk
(*self*, number_of_points**,** init_factor=5**,** pcl=None**)**
函数从网格中取样点,其中每个点到邻近点的距离大致相同(蓝色噪声)。 方法是基于 Yuksel
sample_points_uniformly
(*self 自我*, number_of_points=100 点数100**)**
函数来均匀地从网格中取样点。
1 | print("Load a ply point could, print, render it") |
Voxel
Base Voxel class, containing grid id and color
基本体素类,包含网格 id 和颜色
VoxelGrid
open3d.geometry.VoxelGrid
可视化
1 | source = o3.io.read_point_cloud(mscan) |
API detail
open3d.gemotry.TriangleMesh
staticcreate_from_point_cloud_alpha_shape
(*pcd*, alpha**,** tetra_mesh**,** pt_map**)**
staticcreate_from_point_cloud_ball_pivoting
(*pcd*, radii**)**
staticcreate_from_point_cloud_poisson
(*pcd*, depth=8**,** width=0**,** scale=1.1**,** linear_fit=False**)**
open3d.registration.registration_ransac_based_on_feature_matching
Parameters
- source (open3d.geometry.PointCloud) – The source point cloud.
- target (open3d.geometry.PointCloud) – The target point cloud.
- source_feature (open3d.registration.Feature) – Source point cloud feature.
- target_feature (open3d.registration.Feature) – Target point cloud feature.
- max_correspondence_distance (float) – Maximum correspondence points-pair distance.
- estimation_method (open3d.registration.TransformationEstimation, optional**, default=registration::TransformationEstimationPointToPoint without scaling.) – Estimation method. One of (
registration::TransformationEstimationPointToPoint
,registration::TransformationEstimationPointToPlane
) - ransac_n (int**, optional**, default=4) – Fit ransac with
ransac_n
correspondences - checkers (List**[open3d.registration.CorrespondenceChecker]**, optional**, default=[]) – checkers
- criteria (open3d.registration.RANSACConvergenceCriteria, optional**, default=registration::RANSACConvergenceCriteria class with max_iteration=100000**, and max_validation=100) – Convergence criteria
Returns
open3d.registration.RegistrationResult
open3d.registration.RegistrationResult
property
correspondence_set
Correspondence set between source and target point cloud.Type
n x 2
int numpy array源点云与目标点云之间的对应集[source, target]。(此处的源点云与目标点云,均是采样过后的对应关系之间)
property
fitness
The overlapping area (# of inlier correspondences / # of points in target). Higher is better.Typefloat
重叠区域(向内对应的 # / 目标点的 #)。越高越好。
property
inlier_rmse
RMSE of all inlier correspondences. Lower is better.Typefloat
所有相关函数的 RMSE。越低越好。
property
transformation
The estimated transformation matrix.Type
4 x 4
float64 numpy array估计的变换矩阵。
open3d.registration.CorrespondenceCheckerBasedOnDistance
Class to check if aligned point clouds are close (less than specified threshold).
检查对齐的点云是否关闭(小于指定的阈值)。
open3d.registration.CorrespondenceCheckerBasedOnEdgeLength
Check if two point clouds build the polygons with similar edge lengths. That is, checks if the lengths of any two arbitrary edges (line formed by two vertices) individually drawn withinin source point cloud and within the target point cloud with correspondences are similar. The only parameter similarity_threshold is a number between 0 (loose) and 1 (strict)
检查两个点云是否构建边长相似的多边形。 也就是说,检查在源点云和目标点云中单独绘制的任意两条边(由两个顶点组成的直线)的长度是否相似。 唯一的参数相似性阈值是介于0(宽松)和1(严格)之间的数字
open3d.registration.RANSACConvergenceCriteria
定义 RANSAC 的收敛准则。 如果迭代次数达到最大迭代次数,或者验证已经运行了最大验证次数,则 RANSAC 算法停止。 注意,验证是迭代中最昂贵的计算运算符。 大多数迭代并不完全进行验证。 这是至关重要的,以控制最大验证,使计算时间是可接受的。
open3d.geometry.PointCloud
crop(bounding_box, bounding_box**)**
open3d.geometry.OrientedBoundingBox
static create_from_points
get_max_bound(self)
get_min_bound(self)
get_oriented_bounding_box