matlab 图像压缩问题clearInitialImage=imread('lena.bmp');%rat=4;InitialImage=double(InitialImage)/255;% figure(1);imshow(InitialImage);%T=dctmtx(8);DCTCoe=blkproc(InitialImage,[8 8],'P1*x*P2',T ,T');%CoeVar=im2col(DCTCoe,[8 8],'distinct');Coe=Co

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/29 08:01:22
matlab 图像压缩问题clearInitialImage=imread('lena.bmp');%rat=4;InitialImage=double(InitialImage)/255;% figure(1);imshow(InitialImage);%T=dctmtx(8);DCTCoe=blkproc(InitialImage,[8 8],'P1*x*P2',T ,T');%CoeVar=im2col(DCTCoe,[8 8],'distinct');Coe=Co
xT]Of+A$^bRI$'v[k9ACʀd$|RFH3~/z7giE>$=7ILFF1,A:l GNLTB̋(Gs(pACK2I]p.~<*Q 2 n_hvjZ⠫A:g.bYBW\oQ~[-T6ZjokK}n^t-Prfon-mhU8-m6.$8닚^A~GY7)sC풥 FS8zw`W]ˀlwei{!?~tVH۷`J>mnizi^<۫W~FBN}c;K[.hP\ 7Qs|۶˗4]Nl  sWLy^r2|!zb|)DCxbBDX6

matlab 图像压缩问题clearInitialImage=imread('lena.bmp');%rat=4;InitialImage=double(InitialImage)/255;% figure(1);imshow(InitialImage);%T=dctmtx(8);DCTCoe=blkproc(InitialImage,[8 8],'P1*x*P2',T ,T');%CoeVar=im2col(DCTCoe,[8 8],'distinct');Coe=Co
matlab 图像压缩问题
clear
InitialImage=imread('lena.bmp');
%
rat=4;
InitialImage=double(InitialImage)/255;
%
figure(1);
imshow(InitialImage);
%
T=dctmtx(8);
DCTCoe=blkproc(InitialImage,[8 8],'P1*x*P2',T ,T');
%
CoeVar=im2col(DCTCoe,[8 8],'distinct');
Coe=CoeVar;
%
[Y,Ind]=sort(CoeVar);
%
[m,n]=size(CoeVar);
Snum=64-64*rat;
for i=1:n
Coe(Ind(1:Snum),i)=0;
end
%
B2=col2im(Coe,[8 8],[256 256],'distinct');
%
I2=blkproc(B2,[8 8],'P1*x*P2',T',T);
%
figure(4);
imshow(I2);
% 计算归一化图像的均方误差
error=InitialImage.^2-I2.^2;
MSE=sum(error(:))/prod(size(I2))
%---------------------------------------------------------以下是错误
Error in ==> blkproc at 89
aa(border(1)+(1:ma),border(2)+(1:na)) = a;
Error in ==> DCTencode at 12
DCTCoe=blkproc(InitialImage,[8 8],'P1*x*P2',T,T');仅出现一张图片

matlab 图像压缩问题clearInitialImage=imread('lena.bmp');%rat=4;InitialImage=double(InitialImage)/255;% figure(1);imshow(InitialImage);%T=dctmtx(8);DCTCoe=blkproc(InitialImage,[8 8],'P1*x*P2',T ,T');%CoeVar=im2col(DCTCoe,[8 8],'distinct');Coe=Co
通常进行小波压缩重构后的图像是与原图像相同尺寸的,除非你将其它高频系数都删去不用.压缩后的图像如果是xcomp的话,直接用size就行了吧.
据我所知xcomp应该不是重构后的图像,只是去噪后的图像,还得进行重构才能得到真正重构的图像.
那可能是我孤陋寡闻了,不过要评价是否被压缩了不是看图像的大小变了没有,而是看压缩后的图像占多少空间,即所占字节数,与原图所占空间相比,这样可以算出被压缩了多少了
那这样的话我看你要修改一下你的参数了,比如thr等应该是阈值吧.如果他里边的数据都成片的相同,应该说已经阈值分割了呀.那我就不太了解了.