资源简介
使用Matlab实现ICP(Iterative Closest Point Algorithm)算法,封装为一个函数!
代码片段和文件信息
function [TR TT] = icp(modeldatamax_itermin_iterfittingthresinit_flagtes_flagrefpnt)
% ICP Iterative Closest Point Algorithm. Takes use of
% Delaunay tesselation of points in model.
%
% Ordinary usage:
%
% [R T] = icp(modeldata)
%
% ICP fit points in data to the points in model.
% Fit with respect to minimize the sum of square
% errors with the closest model points and data points.
%
% INPUT:
%
% model - matrix with model points [Pm_1 Pm_2 ... Pm_nmod]
% data - matrix with data points [Pd_1 Pd_2 ... Pd_ndat]
%
% OUTPUT:
%
% R - rotation matrix and
% T - translation vector accordingly so
%
% newdata = R*data + T .
%
% newdata are transformed data points to fit model
%
%
% Special usage:
%
% icp(model) or icp(modeltes_flag)
%
% ICP creates a Delaunay tessellation of points in
% model and save it as global variable Tes. ICP also
% saves two global variables ir and jc for tes_flag=1 (default) or
% Tesind and Tesver for tes_flag=2 which
% makes it easy to find in the tesselation. To use the global variables
% in icp put tes_flag to 0.
%
%
% Other usage:
%
% [R T] = icp(modeldatamax_itermin_iter...
% fittingthresinit_flagtes_flag)
%
% INPUT:
%
% max_iter - maximum number of iterations. Default=104
%
% min_iter - minimum number of iterations. Default=4
%
% fitting - =2 Fit with respect to minimize the sum of square errors. (default)
% alt. =[2w] where w is a weight vector corresponding to data.
% w is a vector of same length as data.
% Fit with respect to minimize the weighted sum of square errors.
% =3 Fit with respect to minimize the sum to the amount 0.95
% of the closest square errors.
% alt. =[3lambda] 0.0 % In each iteration only the amount lambda of the closest
% points will affect the translation and rotation.
% If 1 % of the closest points will affect the translation and
% rotation in each iteration.
%
% thres - error differens threshold for stop iterations. Default 1e-5
%
% init_flag - =0 no initial starting transformation
% =1 transform data so the mean value of
% data is equal to mean value of model.
% No rotation. (init_flag=1 default)
%
% tes_flag - =0 No new tesselation has to be done. There
% alredy exists one for the current model points.
% =1 A new tesselation of the model points will
% be done. (default)
% =2 A new tesselation of the model points will
% be done. Another search strategy than tes_flag=1
% =3 The c
- 上一篇:RLS_算法matlab实现
- 下一篇:永磁同步电机matlab仿真
相关资源
- 永磁同步电机matlab仿真
- RLS_算法matlab实现
- rbf函数逼近算法
-
SVPWM的simuli
nk仿真(附带Matlab funct - 蚁群算法matlab完整代码
- 相机标定源代码,c、matlab
- LMS算法及归一化LMS算法的MATLAB代码
- lmd算法MATLAB仿真程序
- matlab预处理共轭梯度法
- meanshift的matlab实现及2维图演示代码
- 利用matlab对瑞利衰落信道仿真
- 均匀球体与长方体重力异常正演模拟
- 小波降噪软硬阈值改进阈值matlab代码
- matlab处理Adams仿真KC结果生产报告的程
- 图像的面积计算
- 三电平逆变器
- matlab数据预测模型算法.rar
- 惯导IMU初始姿态解算粗对准MATLAB
- emd分解matlab程序172943
- 小波神经网络MATLAB代码.zip
- 现代控制系统第十二版配套matlab
- 三周期极小曲面建模代码
- 直方图均衡化Matlab源代码
- 基本Snake活动轮廓模型
- 汽车动力模型 发动机模型matlab/simul
-
VSG控制simuli
nk仿真 - 人造地震动matlab源代码
- 坐标轮换法
- 一维搜索——外推法
- 复杂网络最短路径matlab
评论
共有 条评论