|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
程序:
function b = blur(N,band,sigma)
X=imread('barbara(web)','jpg');
z = [exp(-((0:band-1).^2)/(2*sigma^2)),zeros(1,N-band)];
T =sparse(1/sqrt(2*pi*sigma)* toeplitz(z));
%A = sparse(kron(T,T));
x=reshape(X,N^2,1);
%%compute kron(T,T)*x
b=zeros(N^2,1);
for i=1:N
for j=max(1,i-band):min(N,i+band)
b((i-1)*N+1:i*N)=b((i-1)*N+1:i*N)+T(i,j)*(T*x((j-1)*N+1:j*N));
end
end
输入:blur(256,15,80) 运行,然后报错。。
??? Error using ==> mtimes
MTIMES is not fully supported for integer classes. At least one input must be scalar.
Error in ==> blur at 12
b((i-1)*N+1:i*N)=b((i-1)*N+1:i*N)+T(i,j)*(T*x((j-1)*N+1:j*N));
Error in ==> cglsk at 9
b = blur(N,band,sigma);
本人超级小白,求大家帮下啊... |
|