该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
错误使用 imlincomb
需要的 输入数目 1, K1, 应为 实数。
出错 imlincomb>ParseInputs (line 140)
validateattributes(varargin{p}, {'double'}, {'real' 'nonsparse'
'scalar'}, ...
出错 imlincomb (line 70)
[ims, scalars, outputClass] = ParseInputs(varargin{:});
出错 mat2gray (line 42)
I = imlincomb(delta, A, -limits(1)*delta, 'double');
出错 main>edgecheck_Callback (line 194)
gradiant=mat2gray(G1);
出错 gui_mainfcn (line 95)
feval(varargin{:});
出错 main (line 42)
gui_mainfcn(gui_State, varargin{:});
代码:
img_src=getappdata(handles.figure1,'img_src');
spt=fspecial('sobel');
Rx=imfilter(double(img_src(:,:,1)),spt,'replicate');
Ry=imfilter(double(img_src(:,:,1)),spt,'replicate');
Gx=imfilter(double(img_src(:,:,2)),spt,'replicate');
Gy=imfilter(double(img_src(:,:,2)),spt,'replicate');
Bx=imfilter(double(img_src(:,:,3)),spt,'replicate');
By=imfilter(double(img_src(:,:,3)),spt,'replicate');
gxx=Rx.^2+Gx.^2+Bx.^2;
gyy=Ry.^2+Gy.^2+By.^2;
gxy=Rx.*Ry+Gx.*Gy+Bx.*By;
theta=0.5*(atan(2*gxy./(gxx-gyy+eps)));
G1=0.5*((gxx+gyy)+(gxx-gyy)).*cos(2*theta)+2*gxy.*sin(2*theta);
theta=theta+pi/2;
G2=0.5*((gxx+gyy)+(gxx-gyy)).*cos(2*theta)+2*gxy.*sin(2*theta);
G1=G1.^0.5;
G2=G2.^0.5;
G1=max(G1,G2);
gradiant=mat2gray(G1);
axes(handles.axes2);
imshow(gradiant);
setappdata(handles.figure1,'img_dst',gradiant);
真不知道哪里错了 求大神,,