Matlab code

profileCirrus Hazard
test.m

path(path,'../Nonrigid_Image_Reg_Deform_Method'); % u,v: m/s, -> pixel: load vel.mat; u = double(u)/6*10^3; v = double(v)/6*10^3; true_y = padarray(u, [0,1], 'post'); true_x = padarray(v, [1,0], 'post'); true_x = padarray(true_x, [6,6]); true_y = padarray(true_y, [6,6]); save('truth_xy', 'true_x', 'true_y'); load T; load R; T = double(T); R = double(R); % Normalize T, R, making SSD of T, R = 2000 norm_factor = sqrt(2000/sum((R(:)-T(:)).^2)); T = T * norm_factor; R = R * norm_factor; [Id_X, Id_Y] = ndgrid(1:513, 1:513); T_resampled ... = interp2c(true_x+Id_X, true_y+Id_Y, T, uint32([513,513]),uint32([513,513])); sum((T_resampled(:) - R(:)).^2)