I=imread('c.bmp');
subplot(221);
imshow(I);
title('原始图像');
I1=double(I);
[m,n]=size(I);
[c,s] = wavedec2(I1,2,'db1');
sizei1 = size(I1)
sizec = size(c)
val_s = s
ca2 = appcoef2(c,s,'db1',2);
sizeca2 = size(ca2)
for i=1:sizeca2(2)
if(c(i)>180)
c(i)=2*c(i);
else
c(i)=0.5*c(i);
end
end
ca1 = appcoef2(c,s,'db1',1);
sizeca1 = size(ca1)
for i=1:sizeca1(2)
if(c(i)>180)
c(i)=2*c(i);
else
c(i)=0.5*c(i);
end
end
[chd2,cvd2,cdd2] = detcoef2('all',c,s,2);
sizecd2 = size(chd2)
[chd1,cvd1,cdd1] = detcoef2('all',c,s,1);
sizecd1 = size(chd1)
thr = thselect(s(2,:),'minimaxi');
cd1soft = wthresh(cd1,'s',thr);
sizecd1soft = size(cd1soft)
for i=1:sizecd1soft(2)
if(c(i)>180)
c(i)=2*c(i);
else
c(i)=0.5*c(i);
end
end
cd2soft = wthresh(cd2,'s',thr);
sizecd2soft = size(cd2soft)
for i=1:sizecd2soft(2)
if(c(i)>180)
c(i)=2*c(i);
else
c(i)=0.5*c(i);
end
end
c = [ca1,ca2,cd1soft,cd2soft]
X = waverec2(c,s,'db1');
subplot(222);
imshow(X);
title('增强图像');
我是菜鸟!本是要用vc做的,但老师说matlab好做些,就又改了,现在好像就会调用函数,高手帮我改改错吧,要是得重写也要告诉我哦