matlab 毕业答辩,有大神帮我注释一下以下代码么,毕业答辩需要,急求

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

主程序中gui界面的open程序

setappdata(handles.figure1,'axes_svd',handles.axes10);

setappdata(handles.figure1,'axes_time',handles.axes11);

setappdata(handles.figure1,'img_src',0);

在主程序中的导入按钮的程序

[filename,pathname]=uigetfile(...

{'*.bmp;*.jpg;*.png;*.jpeg','ImageFiles(*.bmp,*.jpg,*.png,*.jpeg)';...

'*.*','AllFiles(*.*)'},...

'Pickanimage');

if isequal(filename,0)||isequal(pathname,0)

return;%如果点了“取消”

end

axes(handles.axes_src);

fpath=[pathname filename];

img_src=imread(fpath);

imshow(img_src);

setappdata(handles.figure1,'img_src',img_src);

在主程序中的保存按钮的程序

[filename,pathname...

] =uiputfile({'*.bmp','BMPfiles';'*.jpg;','JPGfiles'},'PickanImage');

if isequal(filename,0)||isequal(pathname,0)

return;%如果点了“取消”

else

fpath = fullfile(pathname,filename);%获得全路径的另一种方法

end

img_src = getappdata(handles.figure1,'img_src');%取得打开图片的数据

imwrite (img_src,fpath);%保存图片

主程序中清除图片的程序

img_src=getappdata(handles.clear,'img_src');

cla(img_src)

主程序中退出界面的程序

close(handles.figure1);

SVD的open程序

h_figure2=findobj('Tag','figure1');

h_figure2=guihandles(h_figure2);

setappdata(handles.figure2,'h_figure2',h_figure2);

setappdata(handles.figure2,'Yasolv1',0);

setappdata(handles.figure2,'val',0);

SVD压缩算法的主体程序

h_figure=getappdata(handles.figure2,'h_figure2');

value=getappdata(handles.figure2,'Yasolv1');

%value=4;

time=[];

nub=[];

img_src=getappdata(h_figure.figure1,'img_src');

hh=getappdata(h_figure.figure1,'axes_svd');

hh2=getappdata(h_figure.figure1,'axes_time');

[a,b,c]=size(img_src);

m=str2num(get(handles.edit2,'String'));

mm=str2num(get(handles.edit1,'String'));

for n=1:m

tic;

for i=1:3

for colum=0:(m-1)

for row = 0: (mm-1)

x=ceil(colum*b/m)+1;

y=ceil((colum+1)*b/m);

w=ceil(row*a/mm)+1;

z=ceil((row+1)*a/mm);

p=img_src(w:z,x:y,i);

[U S V] = svd(double(p));

[a1,b1]=size(p);

q=ceil((-a1-b1+sqrt((a1+b1)*(a1+b1)+4*a1*b1*(1-value)))/2);

R= U(:,1:q)*S(1:q,1:q)*V(:,1:q)';

RGB1(w:z,x:y,i)=uint8(R);

end

end

end

clear U S V;

time=[time toc];

nub=[nub n];

end

axes(hh);

imshow(RGB1);

axes(hh2);

plot(nub,time);

close(handles.figure2);

SVD压缩算法的用户输入数据的程序

input = str2num(get(hObject,'String'));

%Check whether the input

if (isempty(input))

set(hObject,'String','1')

end

value=get(hObject,'Value');

% set(handles.txt_display,'String',num2str(value));

setappdata(handles.figure2,'val',value);

注释越多越好

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值