Undefined function 'datatype' for input arguments of type 'uint8'.

2 次查看(过去 30 天)
% 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);
end
tic
[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);

采纳的回答

Guillaume
Guillaume 2019-1-29
It looks like together with your extract function you should have a datatype function. That function is missing. It's for you to find out why.
The other possibility is that extract expects an object of a special class (who would have a datatype method), not a simple image array. You would have to check the documentation of extract.
datatype is not a matlab function, so it has to come from somewhere else.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by