计算机图像处理实验课处理全部代码Word格式.docx
- 文档编号:18959357
- 上传时间:2023-01-02
- 格式:DOCX
- 页数:23
- 大小:17.69KB
计算机图像处理实验课处理全部代码Word格式.docx
《计算机图像处理实验课处理全部代码Word格式.docx》由会员分享,可在线阅读,更多相关《计算机图像处理实验课处理全部代码Word格式.docx(23页珍藏版)》请在冰豆网上搜索。
);
%imshow(A);
打开文档
%--------------------------------------------------------------------
functionsave_Callback(hObject,eventdata,handles)
functionexit_Callback(hObject,eventdata,handles)
%hObjecthandletoexit(seeGCBO)
%eventdatareserved-tobedefinedinafutureversionofMATLAB
%handlesstructurewithhandlesanduserdata(seeGUIDATA)
functionoo_Callback(hObject,eventdata,handles)%类型转换
%hObjecthandletooo(seeGCBO)
functiongray_Callback(hObject,eventdata,handles)%灰度化
%hObjecthandletogray(seeGCBO)
img2=rgb2gray(img1);
subplot(1,3,2);
imshow(img2);
´
¦
À
í
º
ó
µ
Ä
Í
functionbinary_Callback(hObject,eventdata,handles)%二值化
%hObjecthandletobinary(seeGCBO)
img3=im2bw(img1);
subplot(1,3,3);
imshow(img3);
¶
þ
Ö
»
¯
functionyunsuan_Callback(hObject,eventdata,handles)%图像运算
%hObjecthandletoyunsuan(seeGCBO)
functionjihe_Callback(hObject,eventdata,handles)几何运算
%hObjecthandletojihe(seeGCBO)
functionUntitled_12_Callback(hObject,eventdata,handles)
%hObjecthandletoUntitled_12(seeGCBO)
functionjiangzao_Callback(hObject,eventdata,handles)
A=imnose(img1,'
salt&
pepper'
0.02);
figure,subplot(1,2,1);
imshow(A);
i=1;
while(i<
10)
B=imnose(img1,'
B=double(B);
A=A+B;
i=i+1;
end
A=A/10;
B=unit8(A);
subplot(1,2,2);
functionjianfa_Callback(hObject,eventdata,handles)
%hObjecthandletojianfa(seeGCBO)
functionbig_Callback(hObject,eventdata,handles)
I1=imresize(img1,1.5,'
nearest'
%×
î
½
ü
Á
Ú
²
å
figure,imshow(I1)
functionsmall_Callback(hObject,eventdata,handles)
%hObjecthandletosmall(seeGCBO)
I2=imresize(img1,0.3,'
bilinear'
figure,imshow(I2);
functionleft_Callback(hObject,eventdata,handles)
%hObjecthandletoleft(seeGCBO)
I3=imrotate(img1,90,'
figure,imshow(I3);
functionright_Callback(hObject,eventdata,handles)
%hObjecthandletoright(seeGCBO)
I4=imrotate(img1,270,'
figure,imshow(I4);
functionshuiping_Callback(hObject,eventdata,handles)
%hObjecthandletoshuiping(seeGCBO)
%handlesstructurewithhandlesanduserdata(seeGUIDATA)\
[m,n]=size(img1);
fori=1:
m
forj=1:
n
B(i,j)=img1(i,n-j+1);
end
figure
subplot(1,2,1);
imshow(B);
Ë
®
Æ
functionchuizhi_Callback(hObject,eventdata,handles)
%hObjecthandletochuizhi(seeGCBO)
B(i,j)=img1(m-i+1,j);
¹
±
functionfanxiang_Callback(hObject,eventdata,handles)
%hObjecthandletofanxiang(seeGCBO)
B(i,j)=img1(m-i+1,n-j+1);
·
à
functionfuliye_Callback(hObject,eventdata,handles)
functioncreat_Callback(hObject,eventdata,handles)
globalimg2;
img2=zeros(256,256);
img2(108:
148,108:
148)=1;
subplot(2,2,1);
functionyuanshi_Callback(hObject,eventdata,handles)
f=fft2(img2);
subplot(2,2,2);
imshow(abs(f),[]);
Ê
×
functionjuzhong_Callback(hObject,eventdata,handles)
A=fftshift(f);
%½
«
ä
Ð
Ó
¾
Ø
Õ
µ
ã
Ò
subplot(2,2,3)
imshow(abs(A),[]);
functionzengqiang_Callback(hObject,eventdata,handles)
subplot(2,2,4);
imshow(log(abs(A)),[]);
ö
Ç
¿
functionsanwei_Callback(hObject,eventdata,handles)
f=fftshift(f);
f=abs(f);
n=256;
x=1:
n;
y=1:
figure,mesh(x,y,f(x,y));
È
ý
Î
¬
ø
Â
ç
functionpingyi_Callback(hObject,eventdata,handles)
subplot(3,2,1);
imshow(log(abs(f)),[]);
[m,n]=size(img2);
m;
imgnew(i,j)=((-1)^(i+j))*img2(i,j);
f=fft2(imgnew);
subplot(3,2,2);
img3=zeros(256,256);
img3(118:
138,118:
138)=1;
subplot(3,2,3);
f=fft2(img3);
subplot(3,2,4);
functionxuanzhuan_Callback(hObject,eventdata,handles)
B=imrotate(img2,300,'
crop'
f=fft2(B);
functionUntitled_13_Callback(hObject,eventdata,handles)
%hObjecthandletoUntitled_13(seeGCBO)
functionhuidubianhuan_Callback(hObject,eventdata,handles)
imhist(img2,256);
J=imadjust(img2,[0.1,0.9],[]);
subplot(2,2,3);
imshow(J);
imhist(J,256);
÷
û
functionzhifang_Callback(hObject,eventdata,handles)
J=histeq(img2,64);
ù
â
functioncaise_Callback(hObject,eventdata,handles)
RGB=img1;
R=RGB(:
:
1);
G=RGB(:
2);
B=RGB(:
3);
subplot(4,2,1);
imshow(RGB);
æ
Ê
É
subplot(4,2,3);
imshow(R);
ì
subplot(4,2,4);
imhist(R);
subplot(4,2,5);
imshow(G);
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机 图像 处理 实验 全部 代码
![提示](https://static.bdocx.com/images/bang_tan.gif)