点云配准
基于 ICP 的局部点云配准实验性 API:将 源 点云对齐到 目标,并可选择使用初始位姿猜测。位于 Zivid::Experimental::Toolbox 中,可能会在未事先通知的情况下发生变化。
%%{init: {'themeVariables': {'fontSize': '18px'}, 'flowchart': {'nodeSpacing': 30, 'rankSpacing': 35}}}%%
flowchart LR
SourcePC["PointCloud (source)"]
TargetPC["PointCloud (target)"]
registrationOp(["localPointCloudRegistration()"])
transformOp(["transform()"])
residualOp(["residual()"])
LocalPointCloudRegistrationResult
Matrix4x4
Residual["residual (mm)"]
SourcePC -.-> registrationOp --> LocalPointCloudRegistrationResult
TargetPC -.-> registrationOp
LocalPointCloudRegistrationResult --> transformOp --> Matrix4x4
LocalPointCloudRegistrationResult --> residualOp --> Residual
classDef zividClass fill:#4A8FA4,stroke:#34323D,color:#FFFFFF
classDef api fill:#91D2C8,stroke:#4A8FA4,color:#000000
class SourcePC,TargetPC,LocalPointCloudRegistrationResult,Matrix4x4,Residual zividClass
class registrationOp,transformOp,residualOp api
localPointCloudRegistration
使用 ICP 将源点云对齐到目标点云。当点云之间存在明显偏移时,提供可选的初始变换猜测可以提高收敛速度和准确度。
-
LocalPointCloudRegistrationResult localPointCloudRegistration(const UnorganizedPointCloud &target, const UnorganizedPointCloud &source, const LocalPointCloudRegistrationParameters ¶ms, const Pose &initialTransform = Pose{Matrix4x4::identity()})
Compute alignment transform between two point clouds.
Given a
sourcepoint cloud and atargetpoint cloud, this function attempts to compute the transform that must be applied to thesourcein order to align it with thetarget. This can be used to create a "stitched" unorganized point cloud of an object by combining data collected from different camera angles.This function takes an argument
initialTransformwhich is used as a starting-point for the computation of the transform that best alignssourcewithtarget. This initial guess is usually found from e.g. reference markers or robot capture pose, and this function is then used to refine the alignment. If the overlap ofsourceandtargetis already quite good, one can pass the identity matrix asinitialTransform.The returned transform represents the total transform needed to align
sourcewithtarget, i.e. it includes bothinitialTransformand the refinement found by the algorithm.Performance is very dependent on the number of points in either point cloud. To improve performance, voxel downsample one or both point clouds before passing them into this function. The resulting alignment transform can then be applied to the non-downsampled point clouds to still obtain a dense result.
Performance is also very dependent on
MaxCorrespondenceDistance. To improve performance, try reducing this value. However, keep the value larger than the typical point-to-point distance in the point clouds, and larger than the expected translation error in the initial guess.- 参数:
target -- The point cloud to align with
source -- The point cloud to be aligned with target
params -- Parameters for the registration process and its convergence criteria
initialTransform -- Initial guess applied to source point cloud before refinement
- 返回:
Instance of LocalPointCloudRegistrationResult
-
class PointCloudRegistration
Point cloud registration functionality.
Public Static Functions
- static LocalPointCloudRegistrationResult ^ LocalPointCloudRegistration (Zivid::NET::UnorganizedPointCloud^ target, Zivid::NET::UnorganizedPointCloud^ source, Zivid::NET::Experimental::LocalPointCloudRegistrationParameters^ parameters, Zivid::NET::Calibration::Pose^ initialTransform)
Compute alignment transform between two point clouds.
Given a
sourcepoint cloud and atargetpoint cloud, this function attempts to compute the transform that must be applied to thesourcein order to align it with thetarget. This can be used to create a "stitched" unorganized point cloud of an object by combining data collected from different camera angles.This function takes an argument
initialTransformwhich is used as a starting-point for the computation of the transform that best alignssourcewithtarget. This initial guess is usually found from e.g. reference markers or robot capture pose, and this function is then used to refine the alignment. If the overlap ofsourceandtargetis already quite good, one can pass the identity matrix asinitialTransform.The returned transform represents the total transform needed to align
sourcewithtarget, i.e. it includes bothinitialTransformand the refinement found by the algorithm.Performance is very dependent on the number of points in either point cloud. To improve performance, voxel downsample one or both point clouds before passing them into this function. The resulting alignment transform can then be applied to the non-downsampled point clouds to still obtain a dense result.
Performance is also very dependent on
MaxCorrespondenceDistance. To improve performance, try reducing this value. However, keep the value larger than the typical point-to-point distance in the point clouds, and larger than the expected translation error in the initial guess.- 参数:
target -- The point cloud to align with
source -- The point cloud to be aligned with target
parameters -- Parameters for the registration process and its convergence criteria
initialTransform -- Initial guess applied to source point cloud before refinement
- 返回:
Instance of LocalPointCloudRegistrationResult
- local_point_cloud_registration(
- target: UnorganizedPointCloud,
- source: UnorganizedPointCloud,
- parameters: LocalPointCloudRegistrationParameters | None = None,
- initial_transform: Pose | Matrix4x4 | ndarray | None = None,
Compute alignment transform between two point clouds.
Given a
sourcepoint cloud and atargetpoint cloud, this function attempts to compute the transform that must be applied to thesourcein order to align it with thetarget. This can be used to create a "stitched" unorganized point cloud of an object by combining data collected from different camera angles.This function takes an argument
initial_transformwhich is used as a starting-point for the computation of the transform that best alignssourcewithtarget. This initial guess is usually found from e.g. reference markers or robot capture pose, and this function is then used to refine the alignment. If the overlap ofsourceandtargetis already quite good, one can pass the identity pose asinitial_transform.The returned transform represents the total transform needed to align
sourcewithtarget, i.e. it includes bothinitial_transformand the refinement found by the algorithm.Performance is very dependent on the number of points in either point cloud. To improve performance, voxel downsample one or both point clouds before passing them into this function. The resulting alignment transform can then be applied to the non-downsampled point clouds to still obtain a dense result.
Performance is also very dependent on
MaxCorrespondenceDistance. To improve performance, try reducing this value. However, keep the value larger than the typical point-to-point distance in the point clouds, and larger than the expected translation error in the initial guess.- 参数:
target -- The target UnorganizedPointCloud to align with
source -- The source UnorganizedPointCloud to be aligned with target
parameters -- An optional LocalPointCloudRegistrationParameters instance. If not provided, default parameters are used.
initial_transform -- Optional transform (Pose/Matrix4x4/ndarray) be used as a starting point for the algorithm. If not provided, the identity transform is used.
- 返回:
A LocalPointCloudRegistrationResult instance
- class LocalPointCloudRegistrationParameters(
- max_correspondence_distance: float | int = 10.0,
- max_iteration_count: int = 200,
- convergence_criteria: LocalPointCloudRegistrationParameters | None = None,
Input parameters for controlling the local point cloud registration process.
Initialization
- class ConvergenceCriteria( )
Criteria for ending iteration early. Iteration will end when all criteria are satisfied.
Initialization
- property rmse_diff_threshold
Stop iteration when the absolute change in root mean square error (RMSE) from previous iteration is less than this threshold. RMSE is defined as the square root of the average squared distance between corresponding points in the source and target point clouds.
- property source_coverage_diff_threshold
Stop iteration when the absolute change in coverage from previous iteration is less than this threshold. Coverage is defined as the fraction of points in the source point cloud that found a correspondence in the target point cloud.
- property max_correspondence_distance
The radius around each source point in which the algorithm will look for neighbors in the target point cloud. Should be larger than the typical distance between points in the point clouds. This parameter may have a significant performance impact.
- property max_iteration_count
End iteration when reaching this number, even if convergence criteria are not yet satisfied.
- property convergence_criteria
Criteria for ending iteration early. Iteration will end when all criteria are satisfied.
- classmethod load(file_name)
Construct LocalPointCloudRegistrationParameters by loading from file
- save(file_name)
Save to the given file
- classmethod from_serialized(value)
Construct a new LocalPointCloudRegistrationParameters instance from a previously serialized string
See also serialize.
- serialize()
Serialize to a string
See also from_serialized. The returned string is formatted in YAML, and is compatible with the contents of files saved using save.
LocalPointCloudRegistrationResult
点云配准的结果。提供估计的 4×4 变换矩阵以及逐点重叠残差。
-
class LocalPointCloudRegistrationResult
The result of a call to localPointCloudRegistration()
Public Functions
-
Pose transform() const
The transform that must be applied to the source point cloud for it to align with the target point cloud.
-
bool converged() const
A boolean indicating whether the convergence criteria were satisfied before reaching the iteration limit.
-
float sourceCoverage() const
The fraction of points in the source point cloud that has a correspondence in the target point cloud after transformation.
-
float rootMeanSquareError() const
The root mean squared distance between corresponding points in the source and target point cloud after transformation.
-
std::string toString() const
Get string representation of the result.
-
Pose transform() const
-
class LocalPointCloudRegistrationResult
The result of a call to LocalPointCloudRegistration()
Public Functions
-
LocalPointCloudRegistrationResult(const Zivid::Experimental::Toolbox::LocalPointCloudRegistrationResult &nativeResult)
Constructs a LocalPointCloudRegistrationResult from native result.
- System::String ^ ToString () override
Get string representation of this object.
Properties
- Zivid::NET::Calibration::Pose^ Transform
The transform that must be applied to the source point cloud for it to align with the target point cloud.
-
bool Converged
A boolean indicating whether the convergence criteria were satisfied before reaching the iteration limit.
-
float SourceCoverage
The fraction of points in the source point cloud that has a correspondence in the target point cloud after transformation.
-
float RootMeanSquareError
The root mean squared distance between corresponding points in the source and target point cloud after transformation.
-
LocalPointCloudRegistrationResult(const Zivid::Experimental::Toolbox::LocalPointCloudRegistrationResult &nativeResult)
- class LocalPointCloudRegistrationResult(impl)
The result of a call to local_point_cloud_registration.
Initialization
Initialize LocalPointCloudRegistrationResult wrapper.
This constructor is only used internally, and should not be called by the end-user.
- 参数:
impl -- Reference to internal/back-end instance.
- 抛出:
TypeError -- If argument does not match the expected internal class.
- transform() Pose
The transform that must be applied to the source point cloud for it to align with the target point cloud.
- 返回:
A rigid transform as a Pose instance
- converged() bool
A boolean indicating whether the convergence criteria were satisfied before reaching the iteration limit.
- 返回:
A boolean indicating convergence
另请参阅