%% TO RUN FUNCTION IN MATLAB, DELETE THIS LINE AND SAVE AS .m FILE BEFORE USE. function [ ImageRegistered ] = registration( fixedimage, movingimage ) %REGISTRATION Register two images % Registration of two images fixed = fixedimage; moving = movingimage; % Uncomment the following line to see the differences between the two images % to register: % imshowpair(fixed, moving,'diff'); % Create a configuration suitable for registering images from the different sensors. [optimizer, metric] = imregconfig('monomodal'); % Perform the registration. ImageRegistered = imregister(moving, fixed, 'translation', optimizer, metric); % Uncomment the following two lines to see the differences between the two % images after the registration process: % figure % imshowpair(fixed, ImageRegistered,'diff'); close all end