只介绍两种方法:
第一种为手动选关键点:
function on2 = registerImages1(MOVING,FIXED,type)
cpselect(FIXED, MOVING) %选择关键点
flag = input('Hit the Enter key after you finished control points selection');
mytform = cp2tform(input_points,base_points, 'projective');%求出投影变化的矩阵
registered = imtransform(MOVING, mytform, 'bicubic');%进行变化
on2=registered;%输出变换结果
end
第二种为image process toolbox中的自动feature-based 函数中的SURF 函数:
function on2 = registerImages1(MOVING,FIXED,type)
% This function can be used to image registration
% moving is image A, fixed is image B,
% type is the method used
% type 'no'do not use image registration
% type 'auto' use the automatic image registration.
% type 'user' use the user defined control points to registration
%registerImages Re