




版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、 MATLAB 實(shí)踐課程設(shè)計(jì)學(xué)生姓名:學(xué)號(hào):專(zhuān)業(yè)班級(jí):指導(dǎo)教師:二年3月 1 日目錄1.設(shè)計(jì)目的 (32.題目分析 (33.總體設(shè)計(jì) (34.具體設(shè)計(jì) (55.結(jié)果分析 (346.心得體會(huì) (347.附錄代碼 (361、設(shè)計(jì)目的:綜合運(yùn)用MATLAB工具箱實(shí)現(xiàn)圖像處理的GUI程序設(shè)計(jì),利用MATLAB圖像處理工具箱,設(shè)計(jì)和實(shí)現(xiàn)自己的Photoshop 。2、題目分析利用matlab的GUI程序設(shè)計(jì)一個(gè)簡(jiǎn)單實(shí)用的圖像處理程序。該程序應(yīng)具備圖像處理的常用功能,以滿(mǎn)足用戶(hù)的使用?,F(xiàn)設(shè)計(jì)程序有以下基本功能:1圖像的讀取和保存。2設(shè)計(jì)圖形用戶(hù)界面,讓用戶(hù)能夠?qū)D像進(jìn)行任意的亮度和對(duì)比度變化調(diào)整,顯示和對(duì)
2、比變換前后的圖像。3設(shè)計(jì)圖形用戶(hù)界面,讓用戶(hù)能夠用鼠標(biāo)選取圖像感興趣區(qū)域,顯示和保存該選擇區(qū)域。4編寫(xiě)程序通過(guò)最近鄰插值和雙線(xiàn)性插值等算法將用戶(hù)所選取的圖像區(qū)域進(jìn)行放大和縮小整數(shù)倍的操作,并保存,比較幾種插值的效果。5圖像直方圖統(tǒng)計(jì)和直方圖均衡,要求顯示直方圖統(tǒng)計(jì),比較直方圖均衡后的效果。6能對(duì)圖像加入各種噪聲,并通過(guò)幾種濾波算法實(shí)現(xiàn)去噪并顯示結(jié)果。7額外功能。3、總體設(shè)計(jì) 圖一軟件的總體設(shè)計(jì)界面布局如上圖所示,主要分為2個(gè)部分:顯示區(qū)域與操作區(qū)域。顯示區(qū)域:顯示載入原圖,以及通過(guò)處理后的圖像。操作區(qū)域:通過(guò)功能鍵實(shí)現(xiàn)對(duì)圖像的各種處理。在截圖中可見(jiàn),左部為一系列功能按鍵如“還原”、“撤銷(xiāo)”、“
3、截圖”等等;界面正中部分為圖片顯示部分,界面中下方為系列功能切換選擇組。設(shè)計(jì)完成后運(yùn)行的軟件界面如下: 圖二與圖一先比,運(yùn)行后的界面更為簡(jiǎn)潔。利用“編輯”菜單可調(diào)出相應(yīng)的功能鍵。例如: 4、具體設(shè)計(jì)現(xiàn)介紹各個(gè)功能模塊的功能與實(shí)現(xiàn)。4.1菜單欄的設(shè)計(jì)。 通過(guò)Menu Editor創(chuàng)建如下菜單,通過(guò)以下菜單來(lái)控制顯示或隱藏功能按鍵 以“編輯”菜單中“圖像變形”中的“圖像翻轉(zhuǎn)”為例說(shuō)明實(shí)現(xiàn)用戶(hù)界面功能鍵“圖像翻轉(zhuǎn)”的顯示與隱藏。實(shí)現(xiàn)該功能的程序段如下:function tuxiangfanzhuan_Callback(hObject, eventdata, handles% hObject hand
4、le to tuxiangfanzhuan (see GCBO% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATAset(handles.uipanel7,Visible,on;if strcmp(get(gcbo, Checked,onset(handles.uipanel7,Visible,on;set(gcbo, Checked, off;set(handles.uipanel7,Visibl
5、e,off;elseset(gcbo, Checked, on;end該段程序通過(guò)設(shè)置“圖像翻轉(zhuǎn)”功能鍵對(duì)應(yīng)的句柄uipanel7中的“Visible”屬性的開(kāi)關(guān)來(lái)實(shí)現(xiàn)該功能鍵的顯示隱藏。其他同理。4.2圖像的讀取和保存。(1利用“文件”菜單中的“打開(kāi)”、“保存為”分別實(shí)現(xiàn)圖片的讀取與保存。 利用matlab中“ uigetfile”、“imread”“imshow”實(shí)現(xiàn)圖像文件的讀取與顯示:function openfile_Callback(hObject, eventdata, handles% hObject handle to openfile (see GCBO% eventdat
6、a reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATAfilename,pathname=uigetfile(*.jpg;*.bmp;*.tif;*.*,載入圖像;if isequal(filename,0|isequal(pathname,0errordlg(沒(méi)有選中文件,出錯(cuò);return;elsefile=pathname,filename;global S %設(shè)置一個(gè)全局變量S,保存初始圖像路徑,以便之后的還原操
7、作 S=file;x=imread(file;set(handles.axes1,HandleVisibility,ON;axes(handles.axes1;imshow(x;set(handles.axes1,HandleVisibility,OFF;axes(handles.axes2;imshow(x;handles.img=x;guidata(hObject,handles;end程序關(guān)鍵部分:通過(guò)filename,pathname=uigetfile(*.jpg;*.bmp;*.tif;*.*,載入圖像選擇相應(yīng)路徑打開(kāi)的圖像;通過(guò)file=pathname,filename;x=i
8、mread(file; 讀取選中的圖像;最后,通過(guò)imshow(x在顯示區(qū)域上顯示圖像。(2圖像保存。利用“uiputfile”、“imwrite”函數(shù)實(shí)現(xiàn)圖像文件的保存。 function save_Callback(hObject, eventdata, handles% hObject handle to save (see GCBO% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATAsfi
9、lename ,sfilepath=uiputfile(*.jpg;*.bmp;*.tif;*.*,保存圖像文件,untitled.jpg;if isequal(sfilename,sfilepath,0,0sfilefullname=sfilepath ,sfilename;imwrite(handles.img,sfilefullname;elsemsgbox(你按了取消鍵,保存失敗;end程序關(guān)鍵部分:通sfilename ,sfilepath=uiputfile(*.jpg;*.bmp;*.tif;*.*,保存圖像文件,untitled.jpg選擇圖像文件保存的路徑與格式;然后,通過(guò)s
10、filefullname=sfilepath ,sfilename;imwrite(handles.img,sfilefullname; 實(shí)現(xiàn)對(duì)圖像的保存。(3程序的退出。function exit_Callback(hObject, eventdata, handles% hObject handle to exit (see GCBO% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATAclc;
11、close all;close(gcf;clear;4.3對(duì)圖像進(jìn)行任意的亮度和對(duì)比度變化調(diào)整,顯示和對(duì)比變換前后的圖像。運(yùn)行程序后,通過(guò)“編輯”菜單中的“常用處理”選中“亮度調(diào)節(jié)” 在顯示出相應(yīng)的功能鍵后,通過(guò)載入讀取圖像,比并進(jìn)行處理,效果如下:亮度處理前: 亮度處理后: 實(shí)現(xiàn)程序段如下:% - Executes on button press in radiobutton12.function radiobutton12_Callback(hObject, eventdata, handles% hObject handle to radiobutton12 (see GCBO% eve
12、ntdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA% Hint: get(hObject,Value returns toggle state of radiobutton12 global Taxes(handles.axes2;T=getimage;prompt=調(diào)整倍數(shù);defans=1;p=inputdlg(prompt,input,1,defans;p1=str2num(p1;y=imadjus
13、t(handles.img, , ,p1; %亮度調(diào)節(jié)imshow(y;handles.img=y;guidata(hObject,handles;對(duì)比度處理前: 對(duì)比度處理后(增強(qiáng)3倍: 對(duì)比度減弱1.5倍后: 實(shí)現(xiàn)程序段如下:function uipanel10_SelectionChangeFcn(hObject, eventdata, handles % hObject handle to uipanel10 (see GCBO% eventdata reserved - to be defined in a future version of MATLAB % handles str
14、ucture with handles and user data (see GUIDATA global Tstr=get(hObject,string;axes(handles.axes2;switch strcase增強(qiáng)T=getimage;prompt=輸入?yún)?shù):;defans=1;p=inputdlg(prompt,input,1,defans;p1=str2num(p1;f=immultiply(handles.img,p1;imshow(f;handles.img=f;guidata(hObject,handles;case減弱T=getimage;prompt=輸入?yún)?shù):;de
15、fans=1;p=inputdlg(prompt,input,1,defans;p1=str2num(p1;f=imdivide(handles.img,p1;imshow(f;handles.img=f;guidata(hObject,handles;end該程序段主要通過(guò) f=immultiply(handles.img,p1;p=inputdlg(prompt,input,1,defans;分別實(shí)現(xiàn)圖像對(duì)比度的增強(qiáng)與減弱。4.4 用鼠標(biāo)選取圖像感興趣區(qū)域,顯示和保存該選擇區(qū)域。通過(guò)imcrop(x函數(shù)來(lái)實(shí)現(xiàn)對(duì)圖片某一區(qū)域的截取,截取的圖片在右框中顯示。結(jié)合“保存為”,可把截圖處理后的圖片
16、保存在指定路徑。 實(shí)現(xiàn)程序段如下:% - 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 GUIDATAglobal Taxes(han
17、dles.axes2;T=getimage;x=imcrop(handles.img; %截圖imshow(x;handles.img=x;guidata(hObject,handles;4.5 圖像轉(zhuǎn)化為灰度圖像。由于在matlab中較多的圖像處理函數(shù)支持對(duì)灰度圖像進(jìn)行處理,故對(duì)圖像進(jìn)行灰度轉(zhuǎn)化十分必要??衫胷gb2gray(X函數(shù)對(duì)其他圖像進(jìn)行灰度圖像的轉(zhuǎn)化。轉(zhuǎn)化實(shí)例如下: 實(shí)現(xiàn)程序段如下:% - Executes on button press in radiobutton16.function radiobutton16_Callback(hObject, eventdata, ha
18、ndles% hObject handle to radiobutton16 (see GCBO% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA% Hint: get(hObject,Value returns toggle state of radiobutton16 global Taxes(handles.axes2;T=getimage;x=rgb2gray(handles.img;
19、%RGBimshow(x;handles.img=x;guidata(hObject,handles;4.6對(duì)圖像進(jìn)行放大和縮小整數(shù)倍的操作。通過(guò)imresize(X,n,mode函數(shù)對(duì)圖像X進(jìn)行放大或者縮小。N放大縮小倍數(shù),mode 為采用的方式。通過(guò)處理后可發(fā)現(xiàn)保存的圖片的比原圖放大了(縮小了。實(shí)現(xiàn)的程序段如下:function uipanel9_SelectionChangeFcn(hObject, eventdata, handles% hObject handle to uipanel9 (see GCBO% eventdata reserved - to be defined in
20、 a future version of MATLAB % handles structure with handles and user data (see GUIDATAglobal Tstr=get(hObject,string;axes(handles.axes2;switch strcase最近鄰插值T=getimage;prompt=輸入?yún)?shù):;defans=2;p=inputdlg(prompt,input,1,defans;p1=str2num(p1;f=imresize(handles.img,p1,nearest;imshow(f;handles.img=f;guidata
21、(hObject,handles;case雙線(xiàn)性插值T=getimage;prompt=輸入?yún)?shù):;defans=1;p=inputdlg(prompt,input,1,defans;p1=str2num(p1;f=imresize(handles.img,p1,bilinear;imshow(f;handles.img=f;guidata(hObject,handles;end4.7圖像直方圖統(tǒng)計(jì)和直方圖均衡。(1通過(guò)histeq(X函數(shù)實(shí)現(xiàn)直方圖均衡。因?yàn)榇撕瘮?shù)只能對(duì)灰度圖像進(jìn)行直方圖均衡。故應(yīng)先將彩圖轉(zhuǎn)為灰度圖像。 在上一步的基礎(chǔ)上對(duì)第二幅圖進(jìn)行直方圖均衡: 直方圖均衡實(shí)現(xiàn)程序段如下:%
22、 - 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 global Taxes(handles.axes2;T=get
23、image;h=histeq(handles.img;imshow(h;handles.img=h;guidata(hObject,handles;關(guān)鍵部分:通過(guò) h=histeq(handles.img進(jìn)行直方圖均衡(2直方圖統(tǒng)計(jì)。通過(guò)利用imhist(X函數(shù)來(lái)實(shí)現(xiàn)直方圖統(tǒng)計(jì)。 % - Executes on button press in pushbutton8.function pushbutton8_Callback(hObject, eventdata, handles% hObject handle to pushbutton8 (see GCBO% eventdata reser
24、ved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA axes(handles.axes2;x=imhist(handles.img; %直方圖統(tǒng)計(jì)x1=x(1:10:256;horz=1:10:256;bar(horz,x1;axis(0 255 0 15000;set(handles.axes2,xtick,0:50:255;set(handles.axes2,ytick,0:2000:15000;注意:橫縱坐標(biāo)的范圍應(yīng)選取適
25、當(dāng),否則,統(tǒng)計(jì)圖表有可能超出范圍。4.8加入各種噪聲,并通過(guò)幾種濾波算法實(shí)現(xiàn)去噪。(1加入噪聲。通過(guò)imnoise(I,type,parameters來(lái)加入各種噪聲。加入椒鹽噪聲 加入高斯噪聲: 加入乘性噪聲: 實(shí)現(xiàn)程序段如下:function uipanel4_SelectionChangeFcn(hObject, eventdata, handles % hObject handle to uipanel4 (see GCBO% eventdata reserved - to be defined in a future version of MATLAB % handles struct
26、ure with handles and user data (see GUIDATA global Tstr=get(hObject,string;axes(handles.axes2;switch strcase椒鹽噪聲T=getimage;prompt=數(shù)日椒鹽噪聲參數(shù)1:;defans=0.02;p=inputdlg(prompt,input,1,defans;p1=str2num(p1;f=imnoise(handles.img,salt & pepper,p1;imshow(f;handles.img=f;guidata(hObject,handles;case高斯噪聲T=geti
27、mage;prompt=輸入高斯噪聲1:,輸入高斯噪聲2;defans=0,0.02;p=inputdlg(prompt,input,1,defans;p1=str2num(p1;p2=str2num(p2;f=imnoise(handles.img,gaussian,p1,p2; imshow(f;handles.img=f;guidata(hObject,handles;case乘性噪聲T=getimage;prompt=輸入乘性噪聲1:;defans=0.02;p=inputdlg(prompt,input,1,defans;p1=str2num(p1;f=imnoise(handles
28、.img,speckle,p1;imshow(f;handles.img=f;guidata(hObject,handles;end(2濾除噪聲(椒鹽噪聲。濾波前 中值濾波后 線(xiàn)性濾波后 自適應(yīng)濾波后 實(shí)現(xiàn)程序段如下:function uipanel5_SelectionChangeFcn(hObject, eventdata, handles %圖像濾波% hObject handle to uipanel5 (see GCBO% eventdata reserved - to be defined in a future version of MATLAB% handles structu
29、re with handles and user data (see GUIDATAglobal Tstr=get(hObject,string;axes(handles.axes2;switch strcase中值濾波T=getimage;k=medfilt2(handles.img;imshow(k;handles.img=k;guidata(hObject,handles;case線(xiàn)性濾波T=getimage;h=1 1 1;1 1 1;1 1 1;H=h/9;i=double(handles.img;k=convn(i,h;imshow(k,;handles.img=k;guidata
30、(hObject,handles;case自適應(yīng)濾波T=getimage;k=wiener2(handles.img,5,5; imshow(k;handles.img=k;guidata(hObject,handles;end低通濾波器濾波后 高通濾波器濾波后 實(shí)現(xiàn)程序如下:% - Executes on button press in pushbutton14.function pushbutton14_Callback(hObject, eventdata, handles% hObject handle to pushbutton14 (see GCBO% eventdata rese
31、rved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATAaxes(handles.axes2;y1=handles.img;f=double(y1; % 數(shù)據(jù)類(lèi)型轉(zhuǎn)換,matlab不支持圖像的無(wú)符號(hào)整型的計(jì)算g=fft2(f; % 傅里葉變換g=fftshift(g; % 轉(zhuǎn)換數(shù)據(jù)矩陣M,N=size(g;nn=2; %二階巴特沃斯低通濾波器d0=50; %截止頻率50m=fix(M/2; n=fix(N/2;for i=1:Mfo
32、r j=1:Nd=sqrt(i-m2+(j-n2;h=1/(1+0.414*(d/d0(2*nn; % 計(jì)算低通濾波器傳遞函數(shù) result(i,j=h*g(i,j;endendresult=ifftshift(result;y2=ifft2(result;y3=uint8(real(y2;imshow(y3; % 顯示處理后的圖像% - Executes on button press in pushbutton15.function pushbutton15_Callback(hObject, eventdata, handles% hObject handle to pushbutton
33、15 (see GCBO% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATAaxes(handles.axes2;x=(handles.img;f=double(x; % 數(shù)據(jù)類(lèi)型轉(zhuǎn)換k=fft2(f; % 傅里葉變換g=fftshift(k; % 轉(zhuǎn)換數(shù)據(jù)矩陣M,N=size(g;nn=2;d0=25; %截止頻率25m=fix(M/2; n=fix(N/2;for i=1:Mfor j=1:N
34、d=sqrt(i-m2+(j-n2; % 計(jì)算高通濾波器傳遞函數(shù)if d=d0h=0;else h=1;endresult(i,j=h*g(i,j;endendresult=ifftshift(result;y2=ifft2(result;y3=uint8(real(y2;imshow(y3; % 顯示濾波處理后的圖像4.9還原通過(guò)一個(gè)全局變量保存原始圖像路徑,在需要還原至原始圖像時(shí),重新讀取該全局變量即可。實(shí)現(xiàn)程序段如下:% - Executes on button press in pushbutton9.function pushbutton9_Callback(hObject, eve
35、ntdata, 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 global S %還原axes(handles.axes2;y=imread(S;f=imshow(y;handles.img=y;guidata(hObject,handles;4.10 撤銷(xiāo)。撤銷(xiāo)上一步的操作。通過(guò)另設(shè)一個(gè)全局變
36、量T保存是上一次操作后的圖像。實(shí)現(xiàn)程序段如下:- 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 GUIDATAaxes(hand
37、les.axes2; %撤銷(xiāo)global Timshow(T;handles.img=T;guidata(hObject,handles;該程序段只是簡(jiǎn)單的顯示圖像的功能,其中全局變量T中儲(chǔ)存的是上一步操作處理后的圖像信息。在以上的各段功能程序段中可見(jiàn)均有“T=getimage;”,此句把當(dāng)前操作前的圖像,即上一次操作后的圖像信息賦予全局變量T。4.11 圖像變形。(1圖像翻轉(zhuǎn)。實(shí)現(xiàn)圖像的鏡像翻轉(zhuǎn)。左右翻轉(zhuǎn): 上下翻轉(zhuǎn) 實(shí)現(xiàn)程序如下:function uipanel7_SelectionChangeFcn(hObject, eventdata, handles %圖像翻轉(zhuǎn)% hObject h
38、andle to uipanel7 (see GCBO% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATAstr=get(hObject,string;axes(handles.axes2;global Tswitch strcase左右翻轉(zhuǎn)T=handles.img;f=fliplr(handles.img;imshow(f;handles.img=f;guidata(hObject,handl
39、es;case上下翻轉(zhuǎn)T=handles.img;f=flipud(handles.img;imshow(f;handles.img=f;guidata(hObject,handles;end程序關(guān)鍵部分:通過(guò)f=fliplr(handles.img; f=flipud(handles.img;分別實(shí)現(xiàn)左右鏡像翻轉(zhuǎn)與上下鏡像翻轉(zhuǎn)。(2圖像旋轉(zhuǎn)。實(shí)現(xiàn)圖像的逆時(shí)針旋轉(zhuǎn)任意角度。 實(shí)現(xiàn)程序段如下:function pushbutton3_Callback(hObject, eventdata, handles %圖像愛(ài)那個(gè)旋轉(zhuǎn)% hObject handle to pushbutton3 (see
40、GCBO% eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA global Taxes(handles.axes2;T=getimage;prompt=旋轉(zhuǎn)角度:;defans=0;p=inputdlg(prompt,input,1,defans;p1=str2num(p1;f=imrotate(handles.img,p1,bilinear,crop;imshow(f;handles.img=f
41、;guidata(hObject,handles;關(guān)鍵部分:通過(guò)p=inputdlg(prompt,input,1,defans;p1=str2num(p1; 來(lái)輸入旋轉(zhuǎn)參數(shù)。通過(guò)函數(shù)f=imrotate(handles.img,p1,bilinear,crop;實(shí)現(xiàn)翻轉(zhuǎn)。4.12特殊處理(1底片效果。將圖像變?yōu)榈灼?并顯示。 實(shí)現(xiàn)程序如下:% - Executes on button press in pushbutton12.function pushbutton12_Callback(hObject, eventdata, handles% hObject handle to pushb
42、utton12 (see GCBO% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATAglobal Taxes (handles.axes2;T=getimage;f=imcomplement(handles.img; %圖像取反imshow(f;handles.img=f;guidata(hObject,handles;程序段關(guān)鍵部分:通過(guò)f=imcomplement(handles.img;實(shí)現(xiàn)
43、圖像取反,形成底片效果。(2邊緣信息。采取圖像的邊緣信息。 實(shí)現(xiàn)程序段如下:% - Executes on button press in pushbutton16.function pushbutton16_Callback(hObject, eventdata, handles% hObject handle to pushbutton16 (see GCBO% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see
44、 GUIDATAglobal Taxes(handles.axes2;T=getimage;f=edge(handles.img,canny;imshow(f;handles.img=f;guidata(hObject,handles;程序關(guān)鍵部分:通過(guò)f=edge(handles.img,canny;是實(shí)現(xiàn)邊緣信息的獲取。5、結(jié)果分析軟件測(cè)試基本成功,課題所要求的功能均能較好實(shí)現(xiàn)。但一些功能只支持灰度圖像的處理。其中值得一提的是在濾波處理中的低通濾波與高通濾波的效果。由于一般圖像中含有較多的低頻信息成分高頻成分較少,通過(guò)低通濾波后,噪聲以及高頻成分被濾除,圖像雖有少量失真,略顯模糊,但尚可辨
45、識(shí)。但若是通過(guò)高通濾波后,大量的有效低頻信息被濾除,圖像嚴(yán)重失真,不可辨識(shí)。6、心得體會(huì)通過(guò)為期兩周的matlab課程設(shè)計(jì)實(shí)踐,使我對(duì)matlab的使用有了進(jìn)一步的了解和熟悉。當(dāng)我第一次拿到此次的課題時(shí),感到有些無(wú)所適從。雖然,曾經(jīng)學(xué)習(xí)過(guò)matlab的課程,在課程的考核中也取得了較好的成績(jī),但由于對(duì)matlab的學(xué)習(xí)更多的只是停留在理論上的學(xué)習(xí),在課時(shí)內(nèi)的試驗(yàn)也只是簡(jiǎn)單的基礎(chǔ)性試驗(yàn),所以對(duì)matlab實(shí)際運(yùn)用不是很熟練。雖然對(duì)課題感到很懵懂,但在鄭老師的簡(jiǎn)單提示與指導(dǎo)后,我開(kāi)始找到了解決問(wèn)題的路徑。我選擇的是“利用matlab的GUI程序設(shè)計(jì)一個(gè)簡(jiǎn)單實(shí)用的圖像處理程序”這一課題。本課題的重點(diǎn)是
46、句柄的使用、GUI的使用以及matlab中相關(guān)圖像處理函數(shù)使用。為此,在實(shí)踐正式開(kāi)始前,我利用課余時(shí)間,重新復(fù)習(xí)了matlab教材,專(zhuān)門(mén)借閱了利用matlab進(jìn)行圖像處理的相關(guān)教程,通過(guò)索引網(wǎng)絡(luò)上的相關(guān)資料,為課設(shè)做了較為充分的準(zhǔn)備。在參考了相關(guān)材料及源程序,我對(duì)自己要做的課設(shè)內(nèi)容有了進(jìn)一步的了解,并對(duì)matlab的使用有了更深的體會(huì)。當(dāng)然,在課設(shè)的進(jìn)行過(guò)程中,我還是遇到了不少問(wèn)題。例如,起初由于我對(duì)句柄使用以及一些函數(shù)使用的不恰當(dāng),使得在對(duì)圖像文件的保存上就遇到了問(wèn)題,不過(guò)最后還是在老師的提示下解決了。隨著課設(shè)的進(jìn)行,對(duì)matlab的的熟悉度逐步加深。在基本功不斷扎實(shí)的基礎(chǔ)上,我開(kāi)始進(jìn)行一些
47、擴(kuò)張功能的嘗試,比如還原操作、對(duì)功能鍵實(shí)現(xiàn)顯示和隱藏的功能、實(shí)現(xiàn)撤銷(xiāo)多次前操作等。其中前兩個(gè)較為成功的完成,但在第三個(gè)功能上出現(xiàn)了些問(wèn)題,由于對(duì)matlab中數(shù)組結(jié)構(gòu)體與循環(huán)套用使用的不當(dāng),到實(shí)踐結(jié)束之際也未實(shí)現(xiàn)所犯的錯(cuò)誤,只能退而求次,實(shí)現(xiàn)執(zhí)行撤銷(xiāo)功能(恢復(fù)到上次操作,不能不說(shuō)不是一個(gè)遺憾但是,總體來(lái)說(shuō),此次的課程設(shè)計(jì),還是較為滿(mǎn)意的。它不但鞭策著我去鞏固matlab的基礎(chǔ)理論知識(shí),還提高了我對(duì)matlab的實(shí)際操作運(yùn)用,使得理論與實(shí)踐相結(jié)合,為進(jìn)一步學(xué)習(xí)matlab打下堅(jiān)實(shí)的基礎(chǔ);同時(shí),在實(shí)踐的工程中,也讓我體會(huì)到一種努力付出并得到回報(bào)的滿(mǎn)足感覺(jué)。參考書(shū)目:(五號(hào),宋體加粗1MATLAB實(shí)
48、用教程鄭阿奇電子工業(yè)出版社2MATLAB仿真在信號(hào)處理中的應(yīng)用徐明遠(yuǎn)劉增力西安電子科技大學(xué)出版社附錄:(五號(hào),宋體加粗function varargout = tuxiangchuli(varargin% TUXIANGCHULI M-file for tuxiangchuli.fig% TUXIANGCHULI, by itself, creates a new TUXIANGCHULI or raises the existing% singleton*.% H = TUXIANGCHULI returns the handle to a new TUXIANGCHULI or the h
49、andle to% the existing singleton*.% TUXIANGCHULI(CALLBACK,hObject,eventData,handles,. calls the local% function named CALLBACK in TUXIANGCHULI.M with the given input arguments.% TUXIANGCHULI(Property,Value,. creates a new TUXIANGCHULI or raises the % existing singleton*. Starting from the left, prop
50、erty value pairs are% applied to the GUI before tuxiangchuli_OpeningFunction gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to tuxiangchuli_OpeningFcn via varargin.% *See GUI Options on GUIDEs Tools menu. Choose GUI allows only on
51、e% instance to run (singleton.% See also: GUIDE, GUIDATA, GUIHANDLES% Edit the above text to modify the response to help tuxiangchuli% Last Modified by GUIDE v2.5 14-Mar-2009 21:34:50% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename, .gui_Singleton, gu
52、i_Singleton, .gui_OpeningFcn, tuxiangchuli_OpeningFcn, .gui_OutputFcn, tuxiangchuli_OutputFcn, .gui_LayoutFcn, , .gui_Callback, ;if nargin & ischar(varargin1gui_State.gui_Callback = str2func(varargin1;endif nargoutvarargout1:nargout = gui_mainfcn(gui_State, varargin:;elsegui_mainfcn(gui_State, varar
53、gin:;end% End initialization code - DO NOT EDIT35 / 52% - Executes just before tuxiangchuli is made visible.function tuxiangchuli_OpeningFcn(hObject, eventdata, handles, varargin % This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA% varargin command line arguments to tuxiangchuli (see VARARGIN% Choose default command line output for tuxiangchulihandles.output = hObject;% Update handles stru
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年傳染病防治獸藥合作協(xié)議書(shū)
- 咖啡館室內(nèi)裝修施工方案范文
- 2025年學(xué)生傷害賠償協(xié)議指南與策劃要點(diǎn)
- 摩托車(chē)輛租賃合同
- 新員工入職合同范本
- 非營(yíng)利組織勞動(dòng)合同管理制度范文
- 共享打印文件方案服務(wù)協(xié)議
- 2025年度物聯(lián)網(wǎng)實(shí)習(xí)生實(shí)習(xí)合同
- 二零二五年度終止租賃度假村租賃合同終止協(xié)議書(shū)
- 二零二五年度零星用工合同范本:科技創(chuàng)新研發(fā)團(tuán)隊(duì)勞動(dòng)合同
- 專(zhuān)題02 光現(xiàn)象(5大模塊知識(shí)清單+5個(gè)易混易錯(cuò)+2種方法技巧+典例真題解析)
- 支氣管封堵器在胸科手術(shù)中的應(yīng)用
- 北京市東城區(qū)2021-2022學(xué)年第一學(xué)期四年級(jí)期末考試語(yǔ)文試卷(含答案)
- 《STP市場(chǎng)營(yíng)銷(xiāo)戰(zhàn)略》課件
- 心理健康教育課件教學(xué)
- 河南省勞動(dòng)關(guān)系協(xié)調(diào)員職業(yè)技能大賽技術(shù)工作文件
- 成都實(shí)驗(yàn)中學(xué)2025屆高三最后一模英語(yǔ)試題含解析
- 2024年新《反洗錢(qián)法》修訂要點(diǎn)解讀
- 如何變廢為寶課件
- 中華人民共和國(guó)學(xué)前教育法
- 辯論英文課件教學(xué)課件
評(píng)論
0/150
提交評(píng)論