⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chonggou.asv

📁 数字图像处理
💻 ASV
📖 第 1 页 / 共 2 页
字号:
%        str2double(get(hObject,'String')) returns contents of edit7 as a double


% --- Executes during object creation, after setting all properties.
function edit7_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 load woman
 sX=size(X);
 [cA1,cH1,cV1,cD1]=dwt2(X,'db4');
 A0=idwt2(cA1,cH1,cV1,cD1,'db4',sX);
 ans=max(max(abs(X-A0)))
 nbc=size(map,1);
 colormap(pink(nbc));
 subplot(121);
 image(wcodemat(X,nbc));
title('原始图像');
subplot(122);
image(wcodemat(A0,nbc));
title('重构图像');

% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
open danch

% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
load woman
[c,s]=wavedec2(X,2,'sym5');
a1=wrcoef2('a',c,s,'sym5',1);
a2=wrcoef2('a',c,s,'sym5',2);
hd2=wrcoef2('h',c,s,'sym5',2);
vd2=wrcoef2('v',c,s,'sym5',2);
dd2=wrcoef2('d',c,s,'sym5',2);
sX=size(X)
sa1=size(a1)
shd2=size(hd2)
 nbc=size(map,1);
 colormap(pink(nbc));
  subplot(3,2,1);
 image(wcodemat(X,nbc));
title('原始图像');
subplot(3,2,2);
image(wcodemat(a1,nbc));
title('尺度1的低频图像');
 subplot(3,2,3);
 image(wcodemat(a2,nbc));
title('尺度2的低频图像');
subplot(3,2,4);
image(wcodemat(hd2,nbc));
title('尺度2的水平高频图像');
 subplot(3,2,5);
 image(wcodemat(vd2,nbc));
title('尺度2的垂直高频图像');
subplot(3,2,6);
image(wcodemat(dd2,nbc));
title('尺度2的斜线高频图像');

% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
open duoch

% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
load woman
[c,s]=wavedec2(X,2,'db4');
siz=s(size(s,1),:);
ca1=appcoef2(c,s,'db4',1);
a1=upcoef2('a',ca1,'db4',1,siz);
chd1=detcoef2('h',c,s,1);
hd1=upcoef2('h',chd1,'db4',1,siz);
cvd1=detcoef2('v',c,s,1);
vd1=upcoef2('v',cvd1,'db4',1,siz);
cdd1=detcoef2('d',c,s,1);
dd1=upcoef2('d',cdd1,'db4',1,siz);
 nbc=size(map,1);
 colormap(pink(nbc));
  subplot(321);
 image(wcodemat(X,nbc));
title('原始图像');
subplot(323);
image(wcodemat(a1,nbc));
title('尺度1的低频系数重构图像');
 subplot(324);
 image(wcodemat(hd1,nbc));
title('尺度1的水平高频系数重构图像');
subplot(325);
image(wcodemat(vd1,nbc));
title('尺度1的垂直高频系数重构图像');
 subplot(326);
 image(wcodemat(dd2,nbc));
title('尺度1的斜线高频系数重构图像');


% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton6 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
open xscg

% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

load woman
[c,s]=wavedec2(X,2,'sym4');
a0=waverec2(c,s,'sym4');
ans=max(max(abs(X-a0)))
 nbc=size(map,1);
 colormap(pink(nbc));
  subplot(121);
 image(wcodemat(X,nbc));
title('原始图像');
subplot(122);
image(wcodemat(a0,nbc));
title('重构图像');

% --- Executes on button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton8 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
open dfg

% --- Executes on button press in pushbutton9.
function pushbutton9_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
load woman
[c,s]=wavedec2(X,2,'db1');
sc=size(c)
val_s=s
[nc,ns]=upwlev2(c,s,'db1');
snc=size(nc)
val_ns=ns
cal=appcoef2(nc,ns,'db1',1);
 nbc=size(map,1);
 colormap(pink(nbc));
  subplot(121);
 image(wcodemat(X,nbc));
title('原始图像');
subplot(122);
image(wcodemat(ca1,nbc));
title('尺度1的小波分解低频系数');

% --- Executes on button press in pushbutton10.
function pushbutton10_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton10 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
open dcdcg

% --- Executes on button press in pushbutton11.
function pushbutton11_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
load woman
t=wpdec2(X,2,'db2');
rex=wprec2(t)
subplot(211);
image(X);
colormap(map);
title('原始信号');
subplot(212);
image(rex);
colormap(map);
title('重构后的信号');


% --- Executes on button press in pushbutton12.
function pushbutton12_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton12 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
open tree

% --- Executes on button press in pushbutton13.
function pushbutton13_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton13 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


% --- Executes on button press in pushbutton14.
function pushbutton14_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton14 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
open jiedian

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -