




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、function varargout = tuxiangyuchuli(varargin)%TUXIANGYUCHULI M-file for tuxiangyuchuli.fig% TUXIANGYUCHULI, by itself, creates a new TUXIANGYUCHULI or raises the existing% singleton*.% H = TUXIANGYUCHULI returns the handle to a new TUXIANGYUCHULI or the handle to% the existing singleton*.% TUXIANGYU
2、CHULI('Property','Value',.) creates a new TUXIANGYUCHULI using the% given property value pairs. Unrecognized properties are passed via% varargin to tuxiangyuchuli_OpeningFcn. This calling syntax produces a% warning when there is an existing singleton*.% TUXIANGYUCHULI('CALLBACK
3、39;) and TUXIANGYUCHULI('CALLBACK',hObject,.) call the% local function named CALLBACK in TUXIANGYUCHULI.M with the given input% arguments.% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one% instance to run (singleton)".% See also: GUIDE, GUIDATA, GUIHANDLES %
4、 Edit the above text to modify the response to help tuxiangyuchuli % Last Modified by GUIDE v2.5 07-Sep-2014 18:05:07 % Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, . 'gui_Singleton', gui_Singleton, . 'gui_OpeningFcn', tux
5、iangyuchuli_OpeningFcn, . 'gui_OutputFcn', tuxiangyuchuli_OutputFcn, . 'gui_LayoutFcn', , . 'gui_Callback', );if nargin && ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);end if nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mai
6、nfcn(gui_State, varargin:);end% End initialization code - DO NOT EDIT % - Executes just before tuxiangyuchuli is made visible.function tuxiangyuchuli_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to
7、 be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin unrecognized PropertyName/PropertyValue pairs from the% command line (see VARARGIN) % Choose default command line output for tuxiangyuchulihandles.output = hObject; % Update handles struct
8、ureguidata(hObject, handles); % UIWAIT makes tuxiangyuchuli wait for user response (see UIRESUME)% uiwait(handles.figure1); % - Outputs from this function are returned to the command line.function varargout = tuxiangyuchuli_OutputFcn(hObject, eventdata, handles)% varargout cell array for returning o
9、utput args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structurevarargout1 = handles.output; % - Executes during object creation
10、, after setting all properties.function axes1_CreateFcn(hObject, eventdata, handles)% hObject handle to axes1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called % Hint: place code in OpeningFcn to popula
11、te axes1 % - Executes on mouse press over axes background.function axes1_ButtonDownFcn(hObject, eventdata, handles)% hObject handle to axes1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % - Executes on mouse
12、press over axes background.function axes5_ButtonDownFcn(hObject, eventdata, handles)% hObject handle to axes5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function Untitled_1_Callback(hObject, eventdata, h
13、andles)% hObject handle to Untitled_1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function Untitled_2_Callback(hObject, eventdata, handles)% hObject handle to Untitled_2 (see GCBO)% eventdata reserved - t
14、o be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function Untitled_3_Callback(hObject, eventdata, handles)% hObject handle to Untitled_3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handl
15、es and user data (see GUIDATA) % -%顯示灰度圖像function Untitled_4_Callback(hObject, eventdata, handles)% hObject handle to Untitled_4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)handles.img=getimage(handles.axes1)
16、;axes(handles.axes2);if isrgb(handles.img);y=rgb2gray(handles.img);imshow(y);else handles.img=getimage(handles.axes1); axes(handles.axes2); imshow(handles.img);end % -%顯示直方圖function Untitled_31_Callback(hObject, eventdata, handles)% hObject handle to Untitled_31 (see GCBO)% eventdata reserved - to b
17、e defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)handles.img=getimage(handles.axes2);axes(handles.axes3);imhist(handles.img); % -function Untitled_32_Callback(hObject, eventdata, handles)% hObject handle to Untitled_32 (see GCBO)% eventdata reserved
18、- to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function Untitled_21_Callback(hObject, eventdata, handles)% hObject handle to Untitled_21 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with
19、handles and user data (see GUIDATA) % -function Untitled_22_Callback(hObject, eventdata, handles)% hObject handle to Untitled_21 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function Untitled_23_Callback(h
20、Object, eventdata, handles)% hObject handle to Untitled_22 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -%打開(kāi)文件function Untitled_11_Callback(hObject, eventdata, handles)% hObject handle to Untitled_11 (see G
21、CBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)%選取圖片路徑filename,pathname=uigetfile('*.*','選取圖片');%合成路徑+文件名str=pathname filename; %讀取圖片im=imread(str); %使用第一個(gè)axesaxes(handles.axes1); %顯示圖片imshow(im) % -fu
22、nction Untitled_12_Callback(hObject, eventdata, handles)% hObject handle to Untitled_12 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -%關(guān)閉程序function Untitled_13_Callback(hObject, eventdata, handles)% hObject
23、 handle to Untitled_13 (see GCBO)% 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); % -function Untitled_231_Callback(hObject, eventdata, handles)% hObject handle to Untitled_211 (see GCBO)% eventdat
24、a reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function Untitled_232_Callback(hObject, eventdata, handles)% hObject handle to Untitled_212 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles st
25、ructure with handles and user data (see GUIDATA) % -function Untitled_221_Callback(hObject, eventdata, handles)% hObject handle to Untitled_211 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -function Untitle
26、d_222_Callback(hObject, eventdata, handles)% hObject handle to Untitled_212 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % -%上下翻轉(zhuǎn)function Untitled_211_Callback(hObject, eventdata, handles)% hObject handle to
27、Untitled_211 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)x=getimage(handles.axes1);axes(handles.axes4);if isrgb(x) for k=1:3 y(:,:,k)=flipud(x(:,:,k);%上下翻轉(zhuǎn)函數(shù)endimshow(y);else y=flipud(x); imshow(y);end% -%左右翻
28、轉(zhuǎn)function Untitled_212_Callback(hObject, eventdata, handles)% hObject handle to Untitled_212 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)x=getimage(handles.axes1);axes(handles.axes4);if isrgb(x) for k=1:3 y(:
29、,:,k)=fliplr(x(:,:,k);%左右翻轉(zhuǎn)函數(shù)endimshow(y);else y=flipud(x); imshow(y);end % -%任意角度旋轉(zhuǎn)function Untitled_213_Callback(hObject, eventdata, handles)% hObject handle to Untitled_213 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (
30、see GUIDATA)a=getimage(handles.axes1);axes(handles.axes4);prompt='輸入?yún)?shù)1:'defans='30'p=inputdlg(prompt,'輸入?yún)?shù)',1,defans);p1=str2num(p1);y=imrotate(a,p1); imshow(y);% -%顯示處理前圖像頻譜function Untitled_321_Callback(hObject, eventdata, handles)% hObject handle to Untitled_321 (see GCBO
31、)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)x=getimage(handles.axes2);axes(handles.axes5);if isrgb(x) m=fft2(x(:,:,1); y=fftshift(m); imshow(log(abs(y),);else m=fft2(x); y=fftshift(m); imshow(log(abs(y),);end % -%顯示處理
32、后圖像頻譜function Untitled_322_Callback(hObject, eventdata, handles)% hObject handle to Untitled_322 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)a=getimage(handles.axes4);axes(handles.axes6);if isrgb(a);x=rgb2gra
33、y(a);else x=getimage(handles.axes4); axes(handles.axes6);endif isrgb(x) m=fft2(x(:,:,1); y=fftshift(m); imshow(log(abs(y),);else m=fft2(x); y=fftshift(m); imshow(log(abs(y),);end % -%鄰近的兩點(diǎn)插值縮小function Untitled_2221_Callback(hObject, eventdata, handles)% hObject handle to Untitled_2221 (see GCBO)% ev
34、entdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)a=getimage(handles.axes1);axes(handles.axes4);%鄰近插值放大prompt='輸入放大倍數(shù):'defans='0.2'p=inputdlg(prompt,'輸入放大倍數(shù)',1,defans);p1=str2num(p1);y=imresize(a,p1,'
35、nearest'); %鄰近的兩點(diǎn)插值縮小imshow(y); % -%線性插值縮小function Untitled_2222_Callback(hObject, eventdata, handles)% hObject handle to Untitled_2222 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)a=getimage(handles.axes1
36、);axes(handles.axes4);%鄰近插值放大prompt='輸入放大倍數(shù):'defans='0.2'p=inputdlg(prompt,'輸入放大倍數(shù)',1,defans);p1=str2num(p1);y=imresize(a,p1,'bilinear'); %線性插值縮小imshow(y); % -%三次樣條插值縮小function Untitled_2223_Callback(hObject, eventdata, handles)% hObject handle to Untitled_2223 (see G
37、CBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)a=getimage(handles.axes1);axes(handles.axes4);%鄰近插值放大prompt='輸入放大倍數(shù):'defans='0.2'p=inputdlg(prompt,'輸入放大倍數(shù)',1,defans);p1=str2num(p1);y=imresize(a,
38、p1,'bicubic'); %三次樣條插值放大imshow(y); % -%鄰近的兩點(diǎn)插值放大function Untitled_2211_Callback(hObject, eventdata, handles)% hObject handle to Untitled_2211 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)a=getimage(han
39、dles.axes1);axes(handles.axes4);%鄰近插值放大prompt='輸入放大倍數(shù):'defans='2'p=inputdlg(prompt,'輸入放大倍數(shù)',1,defans);p1=str2num(p1);y=imresize(a,p1,'nearest'); %最近鄰插值法放大imshow(y);% -%線性插值放大function Untitled_2212_Callback(hObject, eventdata, handles)% hObject handle to Untitled_2212
40、(see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)a=getimage(handles.axes1);axes(handles.axes4);%鄰近插值放大prompt='輸入放大倍數(shù):'defans='2'p=inputdlg(prompt,'輸入放大倍數(shù)',1,defans);p1=str2num(p1);y=imresiz
41、e(a,p1,'bilinear'); %線性插值放大imshow(y); % -%三次樣條插值放大function Untitled_2213_Callback(hObject, eventdata, handles)% hObject handle to Untitled_2213 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)a=getimage(h
42、andles.axes1);axes(handles.axes4);%鄰近插值放大prompt='輸入放大倍數(shù):'defans='2'p=inputdlg(prompt,'輸入放大倍數(shù)',1,defans);p1=str2num(p1);y=imresize(a,p1,'bicubic'); %三次樣條插值放大imshow(y); % -%保存灰度圖像function Untitled_121_Callback(hObject, eventdata, handles)% hObject handle to Untitled_121 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)f,p=uiputfile('*.jpg','保存文件');str=strcat(p,f);pix=getframe(handles.axes2);imwrite(pix.cdata,str,'jpg'); % -%保存直方圖function Untitled_122_Ca
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 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ì)用戶上傳內(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 企業(yè)培訓(xùn)課件PPR模板
- 企業(yè)培養(yǎng)新人課件
- 車(chē)輛銷(xiāo)售代理及市場(chǎng)拓展承包協(xié)議
- 企業(yè)國(guó)有產(chǎn)權(quán)管理課件
- 智能化木結(jié)構(gòu)廠房建造與物聯(lián)網(wǎng)技術(shù)集成合同
- 跨國(guó)勞務(wù)派遣與勞動(dòng)合同
- 高速營(yíng)銷(xiāo)方案么
- 文創(chuàng)園區(qū)整體租賃與文化產(chǎn)業(yè)項(xiàng)目開(kāi)發(fā)合同
- 體育館餐飲服務(wù)承包與賽事配套保障合同
- 鉆井堵漏技術(shù)方案
- 適用奶茶店兼職合同協(xié)議
- 國(guó)防教育講座課件
- 2025年全國(guó)保密教育線上培訓(xùn)考試試題庫(kù)附答案【考試直接用】含答案詳解
- 2025年保密觀知識(shí)競(jìng)賽題庫(kù)必考題含答案詳解
- 【作業(yè)設(shè)計(jì)】《跨學(xué)科實(shí)踐:制作簡(jiǎn)易桿秤》作業(yè)設(shè)計(jì)人教版八年級(jí)下冊(cè)物理
- 車(chē)間班組安全培訓(xùn)課件
- 2025春季學(xué)期國(guó)開(kāi)河南電大本科《行政管理理論與實(shí)踐專(zhuān)題講座》一平臺(tái)無(wú)紙化考試(作業(yè)練習(xí)+我要考試)試題及答案
- 馬工程教育學(xué)課程
- 內(nèi)蒙古自治區(qū)某礦區(qū)銀多金屬礦勘探及外圍普查設(shè)計(jì)
- 中國(guó)兒童嚴(yán)重過(guò)敏反應(yīng)診斷與治療建議
- 中醫(yī)課件 第二節(jié)方劑的分類(lèi)及常用方劑(臨本)學(xué)習(xí)資料
評(píng)論
0/150
提交評(píng)論