声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1476|回复: 0

[小波] 求助毕业设计难题

[复制链接]
发表于 2007-6-4 19:04 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
我的论文题目是《基于小波变换的图象压缩技术研究》,需要用MATLAB实现,编一个
窗口界面,上面有几个按钮分别实现不同的图象压缩算法,有谁做过类似的毕业设计或有现成的程序请发给我,如果有论文和配套的程序请发给我。
邮箱:yy210102@163.com

如何在图形界面上打开一个图象文件加到程序中,我原先的程序图形文件是固定的,但用如下程序
figure(2)
[fname,pname]=uigetfile();
%[fname1,fpath1]=uigetfile('*.tif;*.bmp;*.jpeg;pcx;hdf;jpg;tga;xwd','Select the picture');
[X,map]=imread([pname,fname]);
%装载并显示原始图像
%[fname,pname]=uigetfile();
%bel=strcat(pname,fname);
%X=imread(strcat(pname,fname));
%load belmont2;
%X=imread(strcat(pname,fname));
subplot(2,2,1);
image(X);
colormap(map);
title('原始图像 ');axis square;
disp('压缩前图像的大小:');
whos('X')
hx=findobj('tag','edit1');
n=str2num(get(hx,'string'));
%对图像进行若干层小波分解
[c,l]=wavedec2(X,n,'haar');
%提取小波分解结构中的一层的低频系数和高频系数
cA1=appcoef2(c,l,'haar',1);
%水平方向
cH1=detcoef2('h',c,l,1);
%斜线方向
cD1=detcoef2('d',c,l,1);
%垂直方向
cV1=detcoef2('v',c,l,1);
%重构第一层系数
A1=wrcoef2('a',c,l,'haar',1);
H1=wrcoef2('h',c,l,'haar',1);
D1=wrcoef2('d',c,l,'haar',1);
V1=wrcoef2('v',c,l,'haar',1);
c1=[A1 H1;V1 D1];
%显示第一层频率信息
subplot(2,2,2);image(c1);colormap(map);title('分解后的低频和高频信息');
%对图像进行压缩:保留第一层低频信息并对其进行量化编码
ca1=wcodemat(cA1,440,'mat',0);
%改变图像高度并显示
ca1=0.5*ca1;
subplot(2,2,3);image(ca1);
colormap(map);
title('第一次压缩后图像');axis square;
disp('第一次压缩后图像的大小:');
xlabel(['图像的大小',get(ca1,'size'),'%']);
%msgbox('图像的大小&whos(ca1)');
%xlabel(['图像的大小',whos(ca1),'%']);
%压缩图像:保留第二层低频信息并对其进行量化编码
cA2=appcoef2(c,l,'haar',2);
ca2=wcodemat(cA2,440,'mat',0);
ca2=0.5*ca2;
subplot(2,2,4);image(ca2);
colormap(map);
title('第二次压缩后图像');
disp('第二次压缩后图像大小:');
whos('ca2')程序出错,请大家帮助,应该怎么写?
出错信息如下:
压缩前图像的大小:
Name Size Bytes Class

X 429x300x3 386100 uint8 array

Grand total is 386100 elements using 386100 bytes

Warning: CONV2 on values of class UINT8 is obsolete.
Use CONV2(DOUBLE(A),DOUBLE() or CONV2(SINGLE(A),SINGLE() instead.
> In uint8.conv2 at 11
In wconv2 at 25
In dwt2 at 80
In wavedec2 at 52
In xiaobo4>pushbutton16_Callback at 234
In gui_mainfcn at 75
In xiaobo4 at 42
Warning: CONV2 on values of class UINT8 is obsolete.
Use CONV2(DOUBLE(A),DOUBLE() or CONV2(SINGLE(A),SINGLE() instead.
> In uint8.conv2 at 11
In wconv2 at 25
In dwt2 at 83
In wavedec2 at 52
In xiaobo4>pushbutton16_Callback at 234
In gui_mainfcn at 75
In xiaobo4 at 42
??? Error using ==> vertcat
All rows in the bracketed expression must have the same
number of columns.

Error in ==> wavedec2 at 54
s = [size(x);s]; % store size

Error in ==> xiaobo4>pushbutton16_Callback at 234
[c,l]=wavedec2(X,n,'haar');

Error in ==> gui_mainfcn at 75
feval(varargin{;

Error in ==> xiaobo4 at 42
gui_mainfcn(gui_State, varargin{;

??? Error while evaluating uicontrol Callback.

>>
图象的亮度,色度,压缩前后图象大小,尺寸,用什么函数实现?
另外结果如何显示在图形界面上?如何在一个图形界面上打开另一个图形界面?


在此先谢谢了!
回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-22 21:21 , Processed in 0.054052 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表