Main Content

pcregistercpd

使用CPD算法注册两个点云

Description

例子

tform= pcregistercpd(移动,,,,固定的返回一个转换,该转换使用连贯的点漂移(CPD)算法来注册带有固定点云的移动点云[[1]

笔记

考虑使用下采样点云PCDownSamplebefore using pcregistercpd to improve the efficiency of registration.

[[tform,,,,移动] = PCRegisterCPD(移动,,,,固定的还返回与固定点云对齐的转换点云。

[[___,,,,rmse] = PCRegisterCPD(移动,,,,固定的还使用前面的任何语法返回对齐点云之间欧几里得距离的均方根误差。

[[___] = PCRegisterCPD(移动,,,,固定的,,,,名称=值specifies options using one or more name-value arguments in addition to any combination of arguments from previous syntaxes. For example,最大值= 20stops the CPD algorithm after 20 iterations.

Examples

collapse all

Load point cloud data into the workspace. Extract the moving and the fixed point clouds from the point cloud data in workspace.

handData = load('hand3d.mat');移动= handdata.movi​​ng;固定= handdata.fixed;

为了提高CPD登记算法的效率和准确性,将移动和固定点云进行下样本。

朝向采样= pcdownsample(移动,“ graverage”,0.03);固定的Downsampled = pcdownsample(fixed,“ graverage”,0.03);

Display the downsampled point clouds before registration.

figure pcshowpair(movingDownsampled,fixedDownsampled,'MarkerSize',,,,50) xlabel('X')ylabel('Y')zlabel('Z')title(“注册前点云”) 传奇({'Moving point cloud',,,,固定的点云的},'textcolor',,,,'W') 传奇('Location',,,,“南部”

Figure contains an axes object. The axes object with title Point clouds before registration contains 2 objects of type scatter. These objects represent Moving point cloud, Fixed point cloud.

Perform non-rigid registration using the CPD algorithm.

tform = pcregistercpd(movingDownsampled,fixedDownsampled); movingReg = pctransform(movingDownsampled,tform);

注册后显示下采样的点云。

figure pcshowpair(movingReg,fixedDownsampled,'MarkerSize',,,,50) xlabel('X')ylabel('Y')zlabel('Z')title(“注册后的点云”) 传奇({'Moving point cloud',,,,固定的点云的},'textcolor',,,,'W') 传奇('Location',,,,“南部”

Figure contains an axes object. The axes object with title Point clouds after registration contains 2 objects of type scatter. These objects represent Moving point cloud, Fixed point cloud.

输入参数

collapse all

Moving point cloud, specified as apointCloud目的。

固定点云,指定为pointCloud目的。

名称值参数

Specify optional pairs of arguments asname1 = value1,...,namen = valuen,,,,where姓名是参数名称和Valueis the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

在R2021a之前,请使用逗号分隔每个名称和值,并附上姓名用引号。

Example:最大值= 20stops the CPD algorithm after 20 iterations.

转换类型,指定为“非辅助”,,,,'死板的', 或者'Affine'字符向量或字符串标量。

数据类型:char|细绳

Expected percentage of outliers with respect to a normal distribution, specified as a scalar in the range [0, 1). Increasing this value reduces the influence of outliers and noise.

数据类型:单身的|double

最大迭代次数before CPD stops, specified as a positive integer.

数据类型:单身的|double

连续CPD迭代之间的公差,,,,specified as a scalar. The algorithm stops when absolute percentage change in the values of the log likelihood function measured between consecutive iterations reaches or falls below the specified tolerance value. Decreasing this value increases the likelihood of a better alignment.

数据类型:单身的|double

点之间的相互作用(指定为正标量),代表高斯滤波器的标准偏差。典型值在[1.5,3]范围内。增加此值会增加点云中点之间的相互作用。结果,您可以观察到点云中的连贯运动,并且每个点都会发生相同的位移。另外,减少此值会减少点云中的点之间的相互作用。结果,您可以观察到点的局部位移,而输出位移场则表现出局部变形。

笔记

要使用此名称值对,'Transform'must be“非辅助”

数据类型:单身的|double

运动平滑重量,指定为正标量。典型值在[0.1,10]范围内。增加此值以在输出位移场中产生更连贯的运动。

笔记

要使用此名称值对,'Transform'must be“非辅助”

数据类型:单身的|double

显示进度信息,指定为数字或逻辑0((错误的)or1((true)。要显示进度信息,请设置Verbosetrue

Both“最大”and'Tolerance'are used as stopping criteria. The algorithm stops when it satisfies either of the stopping conditions, i.e., when the number of iteration reaches最大值或对数可能性功能的绝对百分比变化小于或等于宽容

输出参数

collapse all

Transformation, returned as a刚性3D,,,,仿射3D对象或位移字段。tform是一个3D转换,可注册移动点云,移动定点cloud,固定的。The output type depends on the value of theTransform财产。

Transform适当的价值 tform
'死板的' 刚性3D目的
'Affine' 仿射3D目的
“非辅助” Displacement field, a numeric matrix of same size and datatype as the地点移动点云对象的属性,移动

转换点云,返回pointCloud目的。The transformed point cloud is aligned with the fixed point cloud,固定的

Root mean square error, returned as a positive real number.rmseis the Euclidean distance between the aligned point clouds.

数据类型:double

Algorithms

References

[[1] Myronenko, A., and X. Song. "Point Set Registration: Coherent Point Drift. "IEEE交易的图案分析和机器智能会议论文集(TPAMI)。第32卷,编号12,2010年12月,第2262–2275页。

扩展功能

版本历史记录

在R2018B中引入