% addpath(genpath('\\mars\usr\FA8_Mikroskopie\FA8_public\PublicFiles\MATLAB\Toolboxes\Restricted\2011-08-10-FAIR'))
addpath(genpath('W:\MATLAB\Toolboxes\Registration\2011-08-10-FAIR'));%cd C:\Program Files\MATLAB\R2018b\toolbox\DIPimage 2.9
a=imread('objphase.jpg');b=imread('calphase.jpg');c=b-91;c(c<0)=0;c(1:end,:)=c(end:-1:1,:); % flip the image
cat(3,a,c)d=extract(resample(rotation(c,45.5*pi/180),[0.8437 0.8437],[-13 5]),size(b)/2);e=extract(a,size(b)/2);cat(3,e,d) % This is a pretty good pre alignment. So now FAIR can do the rest...
useCuda=0;if (useCuda) e=cuda(e); d=cuda(d); enableCuda(); %set_zeros_cuda(1);
%set_ones_cuda(1);
%global zeros; zeros=@(varargin) zeros_cuda(varargin{:});
%set_rand_cuda(1);
endtic[aligned,mytransform]=MultiLevelAlign(e,d); % ist superlangsam auf meinem Laptop aber was solls....
toc% mytransform = [ 0.9975 0.0013 0.6298 -0.0006 1.0032 -0.1691]'; % This is the result of the aligment
% [aligned2]=MultiLevelAlign(e,d,mytransform); % just do the transform
cat(3,d,aligned) % ... perfect
[aligned2,mytransform2]=MultiLevelAlign(e,d,mytransform); % use the same transformation but just apply it
cat(3,d,aligned2) % ... perfect. Also works
Hi
I am very new to programimg so please help me out
While running this i got a error
Undefined function 'datatype' for input arguments of type 'uint8'.
Error in extract (line 54)
out=newim(asize,datatype(img)); % problems with type conversion: +value;
Error in alignRainer (line 13)
e=extract(a,size(b)/2);
Best Answer