% Robust Point Matching (RPM) Demo (version 20000427):
% ----------------------------------------------------
% Copyright (C) 2000 Haili Chui, Anand Rangarajan
%
% Authors: Haili Chui and Anand Rangarajan
% Date: 04/27/2000
%
% Contact Information:
%
% Haili Chui: chui@noodle.med.yale.edu
% Anand Rangarajan: anand@noodle.med.yale.edu
%
% Terms:
%
% The source code (M-files) are provided under the
% terms of the GNU General Public License with an explicit
% clause permitting the execution of the M-files from within
% a MATLAB environment. See the LICENSE file for details.
%
%
% ----------------------------------------------------------------------
% cMIX.m
% ----------------------------------------------------------------------
% Gaussian Mixture Robust Point Matching.
%
% Usage:
%
% [c,d,m] = cMIX (x, y, frac, Tinit, Tfinalfac);
%
% Optional ones:
%
% [c,d] = cMIX (x, y, frac, Tinit, Tfinalfac);
% [c,d] = cMIX (x, y, frac, Tinit, Tfinalfac, disp_flag);
% [c,d] = cMIX (x, y, frac, Tinit, Tfinalfac, disp_flag, m_method);
%
% [w] = cMIX (x, y, z, sigma, frac, Tinit, Tfinalfac);
% [w] = cMIX (x, y, z, sigma, frac, Tinit, Tfinalfac, disp_flag);
% [w] = cMIX (x, y, z, sigma, frac, Tinit, Tfinalfac, disp_flag, m_method,
% icp_sigma);
%
% Notes: the program will set transformation type automatically.
% ['tps', 'rbf'].
%
% 'icp' -- 'icp0', 'icp3', 'icp5'. --> to set k_sigma.
%
% 04/27/00
function [o1,o2,o3] = cMIX (in1,in2,in3,in4,in5,in6,in7,in8,in9);
fig(1); clf; whitebg('k'); set(gcf,'color',[0 0 0]);
% set(gcf,'DoubleBuffer','on')
% Init control parameters:
% ------------------------
perT_maxit = 5;
relax_maxit = 1;
anneal_rate = 0.93;
lamda1_init = 1;
lamda2_init = 0.01;
% default:
% --------
disp_flag = 1;
m_method = 'mixture';
debug_flag = 0;
% check input:
% ------------
% --- [c,d] = cMIX (x, y, frac, Tinit, Tfinalfac) ---------------------------
if (nargin == 5)
x = in1;
y = in2;
frac = in3;
T_init = in4;
T_finalfac = in5;
trans_type = 'tps';
z = x;
sigma = 1;
% --- [c,d] = cMIX (x, y, frac, Tinit, Tfinalfac, disp_flag) --------------
elseif (nargin == 6) & (length(in3) == 1)
x = in1;
y = in2;
frac = in3;
T_init = in4;
T_finalfac = in5;
disp_flag = in6;
trans_type = 'tps';
z = x;
sigma = 1;
% --- [c,d] = cMIX (x, y, frac, Tinit, Tfinalfac, disp_flag, m_method) ------
elseif (nargin == 7) & (length(in3) == 1)
x = in1;
y = in2;
frac = in3;
T_init = in4;
T_finalfac = in5;
disp_flag = in6;
m_method = in7;
trans_type = 'tps';
z = x;
sigma = 1;
% --- [w] = cMIX (x, y, z, sigma, frac, Tinit, Tfinalfac) -----------------
elseif (nargin == 7) & (length(in3) > 1)
x = in1;
y = in2;
z = in3;
sigma = in4;
frac = in5;
T_init = in6;
T_finalfac = in7;
trans_type = 'rbf';
disp_flag = 1;
% --- [w] = cMIX (x, y, z, sigma, frac, Tinit, Tfinalfac, disp_flag) -----
elseif (nargin == 8) & (length(in3) > 1)
x = in1;
y = in2;
z = in3;
sigma = in4;
frac = in5;
T_init = in6;
T_finalfac = in7;
disp_flag = in8;
trans_type = 'rbf';
% --- [w] = cMIX (x,y,z,sigma,frac,Tinit,Tfinalfac,disp_flag,m_method); ---
elseif (nargin == 9) & (length(in3) > 1)
x = in1;
y = in2;
z = in3;
sigma = in4;
frac = in5;
T_init = in6;
T_finalfac = in7;
disp_flag = in8;
m_method = in9;
trans_type = 'rbf';
% --- [theta,tx,ty] = cMIX (x, y, frac, Tinit, Tfinalfac) ----------------------
elseif (nargin == 5) & (nargout == 3)
x = in1;
y = in2;
frac = in3;
T_init = in4;
T_finalfac = in5;
trans_type = 'r+t';
theta = 0; t = zeros (2,1); s = 1;
disp_flag = 1;
z = x;
sigma = 1;
% --- [theta,tx,ty] = cMIX (x, y, frac, Tinit, Tfinalfac, disp_flag) ---------
elseif (nargin == 6) & (nargout == 3)
x = in1;
y = in2;
frac = in3;
T_init = in4;
T_finalfac = in5;
disp_flag = in6;
trans_type = 'r+t';
theta = 0; t = zeros (2,1); s = 1;
z = x;
sigma = 1;
% --- [theta,tx,ty] = cMIX (x, y, frac, Tinit, Tfinalfac,disp_flag, m_method); ---
elseif (nargin == 7) & (nargout == 3)
x = in1;
y = in2;
frac = in3;
T_init = in4;
T_finalfac = in5;
disp_flag = in6;
m_method = in7;
trans_type = 'r+t';
theta = 0; t = zeros (2,1); s = 1;
z = x;
sigma = 1;
else
disp ('# ERROR #: cMIX -- wrong input!');
help cMIX; return;
end;
% take care of 'icp' k_sigma stuff.
if (strcmp(m_method(1:3), 'icp'))
if length(m_method) == 3
k_sigma = 0;
m_method = 'icp';
else
k_sigma = str2num(m_method(4));
m_method = 'icp';
end;
else
k_sigma = 0;
end;
% Init:
% -----
% init x,y,z:
[xmax, dim] = size(x); x = x (1:frac:xmax, :); [xmax, dim] = size(x);
[ymax, tmp] = size(y); y = y (1:frac:ymax, :); [ymax, tmp] = size(y);
[zmax, tmp] = size(z);
if strcmp(trans_type, 'tps')
z = x;
end;
% init m:
m = ones (xmax, ymax) ./ (xmax * ymax);
T0 = max(x(:,1))^2;
moutlier = 1/sqrt(T0)*exp(-1); % /xmax *0.001;
% moutlier = 1/xmax*0.01;
m_outliers_row = ones (1,ymax) * moutlier;
m_outliers_col = ones (xmax,1) * moutlier;
% init transformation parameters:
theta = 0; t = zeros (2,1); s = 1;
c_tps = zeros (xmax,dim+1);
d_tps = eye (dim+1, dim+1);
w = zeros (xmax+dim+1, dim);
% icp: perT_maxit = 1:
if strcmp (m_method(1:3),'icp')
perT_maxit = 1;
end;
% -------------------------------------------------------------------
% Annealing procedure:
% -------------------------------------------------------------------
T = T_init;
T_final = T_init / T_finalfac;
vx = x;
vy = y;
it_total = 1;
flag_stop = 0;
while (flag_stop ~= 1)
for i=1:perT_maxit % repeat at each termperature.
% Given vx, y, Update m:
if debug_flag; disp ('calc m ...'); end;
m = cMIX_calc_m (vx, y, T, m_method, ...
m_outliers_row, m_outliers_col,it_total,k_sigma);
% Given m, update transformation:
vy = m * y ./ ( (sum(m'))' * ones(1,dim));
lamda1 = lamda1_init*length(x)*T;
lamda2 = lamda2_init*length(x)*T;
%lamda1 = lamda1_init;
%lamda2 = lamda2_init;
if debug_flag; disp ('calc c,d ...'); end;
[c_tps, d_tps, w] = cMIX_calc_transformation (trans_type, ...
lamda1, lamda2, sigma, x, vy, z);
% w(1:length(z),:) = w(1:length(z),:)*0
% d_tps = d_tps * 0 + eye(dim+1,dim+1);
% c_tps = c_tps *0;
if debug_flag; disp ('calc new x ...'); end;
[vx] = cMIX_warp_pts (trans_type, x, z, c_tps, d_tps, w, sigma);
end % end of iteration/perT
T = T * anneal_rate;
% Determine if it's time to stop:
% -------------------------------
% when T <= cluster variance, stop.
if T < T_final; flag_stop = 1; end;
str = sprintf ('%s, T = %.4f:\t lamda1: %.4f lamda2: %.4f', ...
m_method,T, lamda1, lamda2);
disp (str);
% Display:
% --------
it_total = it_total + 1;
if (disp_flag == 1) | (flag_stop == 1) | ...
(disp_flag ==2 & mod(it_total,10)==0) | ...
(it_total == 1)
figure(1); clf;
cMIX_plot_simple (2, x, y, z, vx, m, 1/xmax, T, ...
trans_type, c_tps, d_tps, w, sigma, m_method);
pause(0.5);
end;
end % end of annealing.
% return outputs:
% ---------------
if strcmp (trans_type, 'tps')
o1 = c_tps;
o2 = d_tps;
o3 = [];
elseif strcmp (trans_type, 'rbf')
o1 = w;
o2 = [];
o3 = [];
elseif strcmp (trans_type, 'r+t')
o1 = theta;
o2 = tx;
o3 = ty;
end;
o3 = m;
%%%%%
% 1 % %%% cMIX_calc_m %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%
%
% Update m (correspondence).
%
% Usage:
% [m] = cMIX_cal
7941943TPS-RPM.zip_TPS matlab_TPS RPM_plate_rpm_tps


2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)

标题中的“7941943TPS-RPM.zip”是一个压缩文件,其中包含了与“TPS(Thin Plate Splines)”和“RPM(Rigid Body Registration Method)”相关的MATLAB代码或数据。TPS是一种在几何形状匹配中广泛应用的插值方法,特别是在图像处理、计算机图形学和生物医学领域。它通过使用平滑的曲面来近似点集之间的变形,用于非刚体配准。RPM则是一种用于估计两个三维物体之间刚体变换的算法,它通常用于定位、跟踪或比较物体的位置。 描述中提到“使用薄板样条函数,完成点对的非刚体配准方法”,这意味着这个MATLAB代码可能包含实现TPS算法的函数,用于处理两个不同形状的点云之间的非刚性配准问题。非刚体配准允许对象在变形状态下进行匹配,这对于分析如生物组织的运动或者理解物体表面的变化非常有用。 标签中的“tps__matlab”表明了这个项目是用MATLAB语言实现的TPS算法。“tps_rpm”可能是指结合了TPS和RPM两种方法,即在RPM的基础上利用TPS进行更精细的形状匹配。“plate”可能是指薄板,这是TPS方法中的关键概念,而“rpm”和“tps”则是关键词,强调了这两种技术的应用。 至于压缩包中的唯一文件“1140249”,由于没有提供具体名称或扩展名,我们只能推测这可能是MATLAB脚本、数据文件或者函数,用于实现TPS-RPM算法。文件可能包含了输入参数(例如待配准的点集)、计算过程以及输出结果的处理。 在MATLAB中,TPS的实现通常涉及到构建一个由控制点组成的网格,然后通过最小化误差函数来求解权重和坐标变换。RPM通常涉及计算旋转和平移矩阵,以最小化两组点之间的欧氏距离。这两个过程可能会通过优化算法,如梯度下降或Levenberg-Marquardt法,来进行联合优化。 这个压缩包提供了用MATLAB实现的TPS和RPM算法的工具,适用于需要处理非刚体配准问题的场景,比如医学图像分析、机器人定位或3D模型比较等。用户可以利用这些代码对具有形变的物体进行精确匹配,从而获得更深入的理解和分析。


































- 1





















- 粉丝: 101
- 资源: 1万+





我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- frp可用于内网端口映射
- 基于Maxwell的小水电500kW永磁发电机设计与应用
- boost::asio 库源码1.30.2
- frp可用于内网端口映射
- CUDA 快速入门指南.pdf
- strace-5.7-3.el8.x64-86.rpm.tar.gz
- supOS工业互联网与iNeuOS工业互联网操作系统对比
- 永磁同步电机SVPWM矢量控制仿真:原理、实现与结果分析
- jdk-11.0.26-linux-windows
- flash-player-npapi-32.0.0.156-release.x86-64.rpm
- RPMGrabber Pro
- 嵌入式系统中基于STM32的语音控制开关灯系统设计与实现
- 硬件习题题库无答案.pdf
- stratis-cli-2.4.2-1.el8.x64-86.rpm.tar.gz
- 基于FPGA的NVMe协议逻辑实现及其在SSD控制器中的应用
- 计算机课程设计报告.pdf



评论2