MATLAB課程設(shè)計(jì)GUI圖像處理_第1頁
MATLAB課程設(shè)計(jì)GUI圖像處理_第2頁
MATLAB課程設(shè)計(jì)GUI圖像處理_第3頁
MATLAB課程設(shè)計(jì)GUI圖像處理_第4頁
MATLAB課程設(shè)計(jì)GUI圖像處理_第5頁
已閱讀5頁,還剩46頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

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)具備圖像處理的常用功能,以滿足用戶的使用。現(xiàn)設(shè)計(jì)程序有以下基本功能:1)圖像的讀取和保存。2)設(shè)計(jì)圖形用戶界面,讓用戶能夠?qū)D像進(jìn)行任意的亮度和對(duì)比度變化調(diào)整,顯示和對(duì)比變換前后的圖像。3)設(shè)計(jì)圖形用戶界面,讓用戶能夠用鼠標(biāo)選取圖像感興趣區(qū)域,顯示和保存該選擇區(qū)域。

2、4)編寫程序通過最近鄰插值和雙線性插值等算法將用戶所選取的圖像區(qū)域進(jìn)行放大和縮小整數(shù)倍的操作,并保存,比較幾種插值的效果。5)圖像直方圖統(tǒng)計(jì)和直方圖均衡,要求顯示直方圖統(tǒng)計(jì),比較直方圖均衡后的效果。6)能對(duì)圖像加入各種噪聲,并通過幾種濾波算法實(shí)現(xiàn)去噪并顯示結(jié)果。7)額外功能。3、總體設(shè)計(jì) 圖一軟件的總體設(shè)計(jì)界面布局如上圖所示,主要分為2個(gè)部分:顯示區(qū)域與操作區(qū)域。顯示區(qū)域:顯示載入原圖,以及通過處理后的圖像。操作區(qū)域:通過功能鍵實(shí)現(xiàn)對(duì)圖像的各種處理。在截圖中可見,左部為一系列功能按鍵如“還原”、“撤銷”、“截圖”等等 ;界面正中部分為圖片顯示部分,界面中下方為系列功能切換選擇組。設(shè)計(jì)完成后運(yùn)行

3、的軟件界面如下: 圖二 與圖一先比,運(yùn)行后的界面更為簡(jiǎn)潔。利用“編輯”菜單可調(diào)出相應(yīng)的功能鍵。例如:4、具體設(shè)計(jì)現(xiàn)介紹各個(gè)功能模塊的功能與實(shí)現(xiàn)。4.1菜單欄的設(shè)計(jì)。通過Menu Editor創(chuàng)建如下菜單,通過以下菜單來控制顯示或隱藏功能按鍵以“編輯”菜單中“圖像變形”中的“圖像翻轉(zhuǎn)”為例說明實(shí)現(xiàn)用戶界面功能鍵“圖像翻轉(zhuǎn)”的顯示與隱藏。實(shí)現(xiàn)該功能的程序段如下:function tuxiangfanzhuan_Callback(hObject, eventdata, handles)% hObject handle to tuxiangfanzhuan (see GCBO)% eventdata

4、reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)set(handles.uipanel7,'Visible','on');if strcmp(get(gcbo, 'Checked'),'on') set(handles.uipanel7,'Visible','on'); set(gcbo, 'Checked'

5、;, 'off'); set(handles.uipanel7,'Visible','off');else set(gcbo, 'Checked', 'on');end該段程序通過設(shè)置“圖像翻轉(zhuǎn)”功能鍵對(duì)應(yīng)的句柄uipanel7中的“Visible”屬性的開關(guān)來實(shí)現(xiàn)該功能鍵的顯示隱藏。其他同理。4.2圖像的讀取和保存。 (1)利用“文件”菜單中的“打開”、“保存為”分別實(shí)現(xiàn)圖片的讀取與保存。 利用matlab中 “ uigetfile”、“imread” “imshow”實(shí)現(xiàn)圖像文件的讀取與顯示:function

6、openfile_Callback(hObject, eventdata, handles)% hObject handle to openfile (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)filename,pathname=uigetfile('*.jpg''*.bmp''*.tif''*.*',&#

7、39;載入圖像');if isequal(filename,0)|isequal(pathname,0) errordlg('沒有選中文件','出錯(cuò)'); return;else file=pathname,filename; global S %設(shè)置一個(gè)全局變量S,保存初始圖像路徑,以便之后的還原操作 S=file; x=imread(file); set(handles.axes1,'HandleVisibility','ON'); axes(handles.axes1); imshow(x); set(handles

8、.axes1,'HandleVisibility','OFF'); axes(handles.axes2); imshow(x); handles.img=x; guidata(hObject,handles);end程序關(guān)鍵部分: 通過filename,pathname=uigetfile('*.jpg''*.bmp''*.tif''*.*','載入圖像')選擇相應(yīng)路徑打開的圖像;通過file=pathname,filename; x=imread(file); 讀取選中的圖像;最

9、后,通過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 GUIDATA) sfilename ,sfilepath

10、=uiputfile('*.jpg''*.bmp''*.tif''*.*','保存圖像文件','untitled.jpg'); if isequal(sfilename,sfilepath,0,0) sfilefullname=sfilepath ,sfilename; imwrite(handles.img,sfilefullname); else msgbox('你按了取消鍵','保存失敗'); end 程序關(guān)鍵部分:通sfilename ,sfilepath=u

11、iputfile('*.jpg''*.bmp''*.tif''*.*','保存圖像文件','untitled.jpg')選擇圖像文件保存的路徑與格式;然后,通過sfilefullname=sfilepath ,sfilename;imwrite(handles.img,sfilefullname); 實(shí)現(xiàn)對(duì)圖像的保存。(3)程序的退出。 function exit_Callback(hObject, eventdata, handles)% hObject handle to exit (see G

12、CBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)clc;close all;close(gcf);clear;4.3對(duì)圖像進(jìn)行任意的亮度和對(duì)比度變化調(diào)整,顯示和對(duì)比變換前后的圖像。 運(yùn)行程序后,通過“編輯”菜單中的“常用處理”選中“亮度調(diào)節(jié)”在顯示出相應(yīng)的功能鍵后,通過載入讀取圖像,比并進(jìn)行處理,效果如下:亮度處理前: 亮度處理后:實(shí)現(xiàn)程序段如下:% - Executes on but

13、ton press in radiobutton12.function radiobutton12_Callback(hObject, eventdata, handles)% hObject handle to radiobutton12 (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') retur

14、ns toggle state of radiobutton12global Taxes(handles.axes2);T=getimage; prompt='調(diào)整倍數(shù)' defans='1' p=inputdlg(prompt,'input',1,defans); p1=str2num(p1); y=imadjust(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)程序段如

15、下:function uipanel10_SelectionChangeFcn(hObject, eventdata, handles)% hObject handle to uipanel10 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global Tstr=get(hObject,'string');axes(handles.axes2); swi

16、tch str case'增強(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ù):' defans='1' p=input

17、dlg(prompt,'input',1,defans); p1=str2num(p1); f=imdivide(handles.img,p1); imshow(f); handles.img=f; guidata(hObject,handles);end 該程序段主要通過 f=immultiply(handles.img,p1); p=inputdlg(prompt,'input',1,defans);分別實(shí)現(xiàn)圖像對(duì)比度的增強(qiáng)與減弱。 44 用鼠標(biāo)選取圖像感興趣區(qū)域,顯示和保存該選擇區(qū)域。 通過imcrop(x)函數(shù)來實(shí)現(xiàn)對(duì)圖片某一區(qū)域的截取,截取的圖片在右框

18、中顯示。結(jié)合“保存為”,可把截圖處理后的圖片保存在指定路徑。實(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

19、GUIDATA)global Taxes(handles.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_Cal

20、lback(hObject, eventdata, handles)% 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

21、.axes2);T=getimage;x=rgb2gray(handles.img); %RGBͼÏñת»»Îª»Ò¶ÈͼÏñimshow(x);handles.img=x;guidata(hObject,handles);4.6對(duì)圖像進(jìn)行放大和縮小整數(shù)倍的操作。通過imresize(X,n,mode)函數(shù)對(duì)圖像X進(jìn)行放大或者縮小。N放大縮小倍數(shù),mode為采用的方式。 通過處理后可發(fā)現(xiàn)保存的圖片的比原圖放大了

22、(縮小了)。實(shí)現(xiàn)的程序段如下:function uipanel9_SelectionChangeFcn(hObject, eventdata, handles)% hObject handle to uipanel9 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global Tstr=get(hObject,'string');axes(handles.

23、axes2);switch str case'最近鄰插值' 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(hObject,handles); case'雙線性插值' T=getimage; prompt='輸入?yún)?shù):

24、' 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)通過histeq(X)函數(shù)實(shí)現(xiàn)直方圖均衡。因?yàn)榇撕瘮?shù)只能對(duì)灰度圖像進(jìn)行直方圖均衡。故應(yīng)先將彩圖轉(zhuǎn)為灰度圖像。 在上一步的基礎(chǔ)上對(duì)第二幅圖進(jìn)行直方圖均衡:直方圖均衡實(shí)現(xiàn)程序段如下:% -

25、 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

26、image;h=histeq(handles.img); imshow(h);handles.img=h;guidata(hObject,handles); 關(guān)鍵部分:通過 h=histeq(handles.img)進(jìn)行直方圖均衡 (2)直方圖統(tǒng)計(jì)。通過利用imhist(X)函數(shù)來實(shí)現(xiàn)直方圖統(tǒng)計(jì)。% - Executes on button press in pushbutton8.function pushbutton8_Callback(hObject, eventdata, handles)% hObject handle to pushbutton8 (see GCBO)% event

27、data reserved - 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,'yti

28、ck',0:2000:15000);注意:橫縱坐標(biāo)的范圍應(yīng)選取適當(dāng),否則,統(tǒng)計(jì)圖表有可能超出范圍。4.8加入各種噪聲,并通過幾種濾波算法實(shí)現(xiàn)去噪。(1)加入噪聲。通過imnoise(I,type,parameters)來加入各種噪聲。加入椒鹽噪聲加入高斯噪聲:加入乘性噪聲:實(shí)現(xiàn)程序段如下:function uipanel4_SelectionChangeFcn(hObject, eventdata, handles)% hObject handle to uipanel4 (see GCBO)% eventdata reserved - to be defined in a futur

29、e version of MATLAB% handles structure with handles and user data (see GUIDATA)global Tstr=get(hObject,'string');axes(handles.axes2);switch str case '椒鹽噪聲' T=getimage; prompt='數(shù)日椒鹽噪聲參數(shù)1:' defans='0.02' p=inputdlg(prompt,'input',1,defans); p1=str2num(p1); f=imn

30、oise(handles.img,'salt & pepper',p1); imshow(f); handles.img=f; guidata(hObject,handles); case '¸高斯噪聲' T=getimage; prompt='輸入高斯噪聲1:','輸入高斯噪聲2' defans='0','0.02' p=inputdlg(prompt,'input',1,defans); p1=str2num(p1); p2=str2num(p2); f=imn

31、oise(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.img,'speckle',p1); imshow(f); handles

32、.img=f; guidata(hObject,handles); end(2)濾除噪聲(椒鹽噪聲)。濾波前中值濾波后線性濾波后自適應(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 structure with handles and user data

33、 (see GUIDATA)global Tstr=get(hObject,'string');axes(handles.axes2);switch str case '中值濾波' T=getimage; k=medfilt2(handles.img); imshow(k); handles.img=k; guidata(hObject,handles); case '線性濾波' T=getimage; h=1 1 1;1 1 1;1 1 1; H=h/9; i=double(handles.img); k=convn(i,h); imshow(

34、k,); handles.img=k; guidata(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 h

35、andle to pushbutton14 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) axes(handles.axes2);y1=handles.img; f=double(y1); % 數(shù)據(jù)類型轉(zhuǎn)換,matlab不支持圖像的無符號(hào)整型的計(jì)算g=fft2(f); % 傅里葉變換g=fftshift(g); % 轉(zhuǎn)換數(shù)據(jù)矩陣M,N=size(g);nn=2; %二階

36、巴特沃斯低通濾波器d0=50; %截止頻率50m=fix(M/2); n=fix(N/2);for i=1:M for j=1:N d=sqrt(i-m)2+(j-n)2); 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 pushbu

37、tton15_Callback(hObject, eventdata, handles)% hObject handle to pushbutton15 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) axes(handles.axes2);x=(handles.img); f=double(x); % 數(shù)據(jù)類型轉(zhuǎn)換k=fft2(f); % 傅里葉變換g=fftshift

38、(k); % 轉(zhuǎn)換數(shù)據(jù)矩陣M,N=size(g);nn=2;d0=25; %截止頻率25m=fix(M/2); n=fix(N/2);for i=1:M for j=1:N d=sqrt(i-m)2+(j-n)2); % 計(jì)算高通濾波器傳遞函數(shù) if d<=d0 h=0; else h=1; end result(i,j)=h*g(i,j); endendresult=ifftshift(result);y2=ifft2(result);y3=uint8(real(y2);imshow(y3); % 顯示濾波處理后的圖像4.9還原 通過一個(gè)全局變量保存原始圖像路徑,在需要還原至原始圖像時(shí)

39、,重新讀取該全局變量即可。實(shí)現(xiàn)程序段如下:% - 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) global S

40、 %還原 axes(handles.axes2); y=imread(S); f=imshow(y); handles.img=y;guidata(hObject,handles);4.10 撤銷。 撤銷上一步的操作。通過另設(shè)一個(gè)全局變量T保存是上一次操作后的圖像。實(shí)現(xiàn)程序段如下:- Executes on button press in pushbutton11.function pushbutton11_Callback(hObject, eventdata, handles)% hObject handle to pushbutton11 (see GCBO)% eventdata re

41、served - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)axes(handles.axes2); %撤銷global Timshow(T);handles.img=T;guidata(hObject,handles); 該程序段只是簡(jiǎn)單的顯示圖像的功能,其中全局變量T中儲(chǔ)存的是上一步操作處理后的圖像信息。在以上的各段功能程序段中可見均有 “T=getimage;”,此句把當(dāng)前操作前的圖像,即上一次操作后的圖像信息賦予全局變量T。

42、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 handle to uipanel7 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)str=get(hObject,'

43、;string');axes(handles.axes2);global Tswitch str case '左右翻轉(zhuǎn)' T=handles.img; f=fliplr(handles.img); imshow(f); handles.img=f; guidata(hObject,handles); case '上下翻轉(zhuǎn)' T=handles.img; f=flipud(handles.img); imshow(f); handles.img=f; guidata(hObject,handles); end程序關(guān)鍵部分:通過f=fliplr(handle

44、s.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) %圖像愛那個(gè)旋轉(zhuǎn)% hObject handle to pushbutton3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data

45、 (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;guidata(hObject,handles); 關(guān)鍵部分:通過p=inputdlg(prompt,'input&

46、#39;,1,defans);p1=str2num(p1); 來輸入旋轉(zhuǎn)參數(shù)。通過函數(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 pushbutton12 (see GCBO)% eventda

47、ta 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;f=imcomplement(handles.img); %圖像取反´imshow(f);handles.img=f;guidata(hObject,handles); 程序段關(guān)鍵部分:通過f=imcomplement(handles.img);實(shí)現(xiàn)圖像取反,形成底片效果。(

48、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 GUIDATA)gl

49、obal Taxes(handles.axes2); T=getimage;f=edge(handles.img,'canny');imshow(f);handles.img=f;guidata(hObject,handles); 程序關(guān)鍵部分:通過f=edge(handles.img,'canny');是實(shí)現(xiàn)邊緣信息的獲取。5、結(jié)果分析軟件測(cè)試基本成功,課題所要求的功能均能較好實(shí)現(xiàn)。但一些功能只支持灰度圖像的處理。其中值得一提的是在濾波處理中的低通濾波與高通濾波的效果。由于一般圖像中含有較多的低頻信息成分高頻成分較少,通過低通濾波后,噪聲以及高頻成分被濾除,圖

50、像雖有少量失真,略顯模糊,但尚可辨識(shí)。但若是通過高通濾波后,大量的有效低頻信息被濾除,圖像嚴(yán)重失真,不可辨識(shí)。6、心得體會(huì)通過為期兩周的matlab課程設(shè)計(jì)實(shí)踐,使我對(duì)matlab的使用有了進(jìn)一步的了解和熟悉。 當(dāng)我第一次拿到此次的課題時(shí),感到有些無所適從。雖然,曾經(jīng)學(xué)習(xí)過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)后,我開始找到了解決問題的路徑。我選擇的是“利用matlab的GUI程序設(shè)計(jì)一個(gè)簡(jiǎn)單實(shí)用的

51、圖像處理程序”這一課題。本課題的重點(diǎn)是句柄的使用、GUI的使用以及matlab中相關(guān)圖像處理函數(shù)使用。 為此,在實(shí)踐正式開始前,我利用課余時(shí)間,重新復(fù)習(xí)了matlab教材,專門借閱了利用matlab進(jìn)行圖像處理的相關(guān)教程,通過索引網(wǎng)絡(luò)上的相關(guān)資料,為課設(shè)做了較為充分的準(zhǔn)備。在參考了相關(guān)材料及源程序,我對(duì)自己要做的課設(shè)內(nèi)容有了進(jìn)一步的了解,并對(duì)matlab的使用有了更深的體會(huì)。 當(dāng)然,在課設(shè)的進(jìn)行過程中,我還是遇到了不少問題。例如,起初由于我對(duì)句柄使用以及一些函數(shù)使用的不恰當(dāng),使得在對(duì)圖像文件的保存上就遇到了問題,不過最后還是在老師的提示下解決了。隨著課設(shè)的進(jìn)行,對(duì)matlab的的熟悉度逐步加深

52、。在基本功不斷扎實(shí)的基礎(chǔ)上,我開始進(jìn)行一些擴(kuò)張功能的嘗試,比如還原操作、對(duì)功能鍵實(shí)現(xiàn)顯示和隱藏的功能、實(shí)現(xiàn)撤銷多次前操作等 。其中前兩個(gè)較為成功的完成,但在第三個(gè)功能上出現(xiàn)了些問題,由于對(duì)matlab中數(shù)組結(jié)構(gòu)體與循環(huán)套用使用的不當(dāng),到實(shí)踐結(jié)束之際也未實(shí)現(xiàn)所犯的錯(cuò)誤,只能退而求次,實(shí)現(xiàn)執(zhí)行撤銷功能(恢復(fù)到上次操作),不能不說不是一個(gè)遺憾 但是,總體來說,此次的課程設(shè)計(jì),還是較為滿意的。它不但鞭策著我去鞏固matlab的基礎(chǔ)理論知識(shí),還提高了我對(duì)matlab的實(shí)際操作運(yùn)用,使得理論與實(shí)踐相結(jié)合,為進(jìn)一步學(xué)習(xí)matlab打下堅(jiān)實(shí)的基礎(chǔ);同時(shí),在實(shí)踐的工程中,也讓我體會(huì)到一種努力付出并得到回報(bào)的滿足感覺。 參考書目:(五號(hào),宋體加粗)1 MATLAB實(shí)用教程 鄭阿奇 電子工業(yè)出版社2 MATLAB仿真在信號(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%

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論