필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Raviteja Kurva
Raviteja Kurva 2019년 1월 29일
답변: Guillaume 2019년 1월 29일
% 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