imidwt2.m
上传用户:sxdygs
上传日期:2013-03-18
资源大小:154k
文件大小:1k
源码类别:

2D图形编程

开发平台:

Matlab

  1. function Iout2=imidwt2(in,J1)
  2. % 对输入图像in做J1尺度的小波逆变换
  3. K=J1;
  4. [m,n]=size(in);
  5. in1=double(in);
  6. V=zeros(m/(2^(J1-1)),n/(2^(J1-1)));
  7. Iout2=zeros(size(in));
  8. for k=1:K
  9.     for i=1:m/(2^(J1-1))
  10.         for j=1:n/(2^(J1-1))
  11.             V(i,j)=in1(i,j);
  12.         end
  13.     end
  14.     for i=1:m/(2^(J1-1))
  15.          V(i,:)=selfidwt(V(i,:),1);%对行进行变换
  16.     end
  17.     for i=1:n/(2^(J1-1))
  18.          V(:,i)=selfidwt(V(:,i),1);%对列进行变换
  19.     end
  20.     for i=1:m/(2^(J1-1))
  21.         for j=1:n/(2^(J1-1))
  22.            in1(i,j)=V(i,j);
  23.         end
  24.     end
  25.     J1=J1-1;
  26.     V=zeros(m/(2^(J1-1)),n/(2^(J1-1)));
  27. end 
  28. Iout2=in1;
  29. figure
  30. imshow(uint8(Iout2))