?? matlab.asv
字號:
function varargout = matlab(varargin)
% MATLAB M-file for matlab.fig
% MATLAB, by itself, creates a new MATLAB or raises the existing
% singleton*.
%
% H = MATLAB returns the handle to a new MATLAB or the handle to
% the existing singleton*.
%
% MATLAB('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MATLAB.M with the given input arguments.
%
% MATLAB('Property','Value',...) creates a new MATLAB or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before matlab_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to matlab_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help matlab
% Last Modified by GUIDE v2.5 28-Nov-2008 21:45:14
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @matlab_OpeningFcn, ...
'gui_OutputFcn', @matlab_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin & isstr(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before matlab is made visible.
function matlab_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 matlab (see VARARGIN)
% Choose default command line output for matlab
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes matlab wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = matlab_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output 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 structure
varargout{1} = handles.output;
% --- Executes during object creation, after setting all properties.function edit1_CreateFcn(hObject, eventdata, handles)% hObject handle to edit1 (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 set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit1_Callback(hObject, eventdata, handles)% hObject handle to edit1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit1 as text% str2double(get(hObject,'String')) returns contents of edit1 as a double% --- 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)[filename,pathname]=uigetfile({ '*.bmp;*.jpg;*.tif;*.png','All Files(*.bmp,*.jpg,*.tif,*.png)' } ,'打開圖象文件');
if filename==0
else
set(handles.edit1,'string',[pathname,filename]);
end
file=imread([pathname,filename]);
axes(handles.axes1);
imshow(file);% --- 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)Button=questdlg('確定退出?','請選擇','確定','取消','確定');
switch Button
case '確定'
close matlab;
end% --- Executes during object creation, after setting all properties.function popupmenu1_CreateFcn(hObject, eventdata, handles)% hObject handle to popupmenu1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on selection change in popupmenu1.function popupmenu1_Callback(hObject, eventdata, handles)% hObject handle to popupmenu1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns popupmenu1 contents as cell array% contents{get(hObject,'Value')} returns selected item from popupmenu1val = get(hObject,'Value');
str = get(hObject, 'String');
%handles.listbox1是你的listbox的Tag
switch str{val};
case '圖像隔行抽取'
set(handles.edit2,'string',{''});
case '插值放大'
set(handles.edit2,'string',{'本例采用“鄰近點插值法”:在原來圖像的每行每列后面加上左邊和上面的一行像素值。實際上這樣的處理方式將原來的一個像素點,變成灰度值大小相同的4個像素點。從而獲得了數(shù)字圖像在空間尺寸上的放大作用。'});
case '圖像傅立葉變換'
set(handles.edit2,'string',{'傅里葉變換是線性系統(tǒng)分析的一個有力工具,宏觀世界能夠定里地分析諸如數(shù)字化系統(tǒng)、采樣點、電子放大器、卷積濾波器、噪音和顯示點等的作用。通過實驗培養(yǎng)這項技能,將有助于解決大多數(shù)圖像處理問題。對任何想在工作中有效應(yīng)用數(shù)字圖像處理技術(shù)的人來說,把時間用在學(xué)習(xí)和掌握傅里變換上是很有必要的。'});
case '圖像增強'
set(handles.edit2,'string',{'圖象增強是指按特定的需要突出一幅圖象中的某些信息,同時,削弱或去除某些不需要的信息的處理方法。其主要目的是處理后的圖象對某些特定的應(yīng)用比原來的圖象更加有效。圖象增強技術(shù)主要有亮度對比度變換,直方圖修改處理、圖象尖銳化處理等。'});
case '圖像的直方圖'
set(handles.edit2,'string',{'直方圖是圖象的最基本的統(tǒng)計特征,它反映的是圖象的灰度值的分布情況.直方圖操作能有效地用于圖象增強.直方圖均衡化的目的是使圖象在整個灰度值動態(tài)變化范圍內(nèi)的分布均勻化,改善圖象的亮度分布狀態(tài),增強圖象的視覺效果.'});
case '圖像加高斯噪聲'
set(handles.edit2,'string',{'高斯噪聲又叫正態(tài)噪聲,是最普通的一種噪聲。'});
case '圖像加椒鹽噪聲'
set(handles.edit2,'string',{'椒鹽噪聲,是一種脈沖噪聲,脈沖噪聲總是數(shù)字化為最大值和最小值(純白和純黑)的形式對圖像形成干擾。負脈沖以一個黑點出現(xiàn)在圖像中,正脈沖以白點出現(xiàn)圖像中,用“椒鹽”這一詞來進行比喻非常形象。'});
case '圖像的平滑濾波'
set(handles.edit2,'string',{'濾波的機理就是在待復(fù)原圖像中逐點地移動掩模,濾波器在每一點(X,Y)處的響應(yīng)通過事先定義的掩模內(nèi)像素的關(guān)系來計算。'});
case '圖像的中值濾波'
set(handles.edit2,'string',{'濾波的機理就是在待復(fù)原圖像中逐點地移動掩模,濾波器在每一點(X,Y)處的響應(yīng)通過事先定義的掩模內(nèi)像素的關(guān)系來計算。'});
case '圖像的索引'
set(handles.edit2,'string',{' 索引圖像包括圖像矩陣與顏色圖數(shù)組,其中顏色圖是按照圖像顏色值進行排序后的數(shù)組。對于每一個像素,圖像矩陣包含一個值,這個值就是顏色數(shù)據(jù)組中的索引。顏色圖為M*3雙精度值矩陣,各行分別指定RGB單色值。標準的顏色映射包含hsv,hot,cool,pink,bone,jet,copper等。本例只用到'});
case '圖像隔行抽取'
set(handles.edit2,'string',{''});
case '圖像隔行抽取'
set(handles.edit2,'string',{''});
case '圖像隔行抽取'
set(handles.edit2,'string',{''});
case '圖像隔行抽取'
set(handles.edit2,'string',{''});
end
% --- 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)file=get(handles.edit1,'string');val=get(handles.popupmenu1,'value');
switch val;
case 1
run gehang(file);
case 2
run chazhi(file);
case 3
run fuliye(file);
case 4
run zengqiang(file);
case 5
run zhi(file);
case 6
run gau(file);
case 7
run jiaoyan(file);
case 8
run pinghua(file);
case 9
run zhongzhi(file);
case 10
run yansehot(file);
case 11
run weicai(file);
end
% --- Executes during object creation, after setting all properties.function popupmenu2_CreateFcn(hObject, eventdata, handles)% hObject handle to popupmenu2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on selection change in popupmenu2.function popupmenu2_Callback(hObject, eventdata, handles)% hObject handle to popupmenu2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns popupmenu2 contents as cell array% contents{get(hObject,'Value')} returns selected item from popupmenu2val = get(hObject,'Value');
str = get(hObject, 'String');
%handles.listbox1是你的listbox的Tag
switch str{val};
case '1'
set(handles.edit2,'string',{'hrrrrrrrrrrrrrrrrrrr'});
case '2'
set(handles.edit2,'string',{'b','d'});
end% --- 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)file=get(handles.edit1,'string');
val=get(handles.popupmenu2,'value');
switch val;
case 1
run caitufengliang(file);
case 2
run caituchongzu(file)
end
% --- Executes during object creation, after setting all properties.function listbox1_CreateFcn(hObject, eventdata, handles)% hObject handle to listbox1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: listbox controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on selection change in listbox1.function listbox1_Callback(hObject, eventdata, handles)% hObject handle to listbox1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns listbox1 contents as cell array% contents{get(hObject,'Value')} returns selected item from listbox1
% --- Executes during object creation, after setting all properties.function listbox2_CreateFcn(hObject, eventdata, handles)% hObject handle to listbox2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: listbox controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on selection change in listbox2.function listbox2_Callback(hObject, eventdata, handles)% hObject handle to listbox2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns listbox2 contents as cell array% contents{get(hObject,'Value')} returns selected item from listbox2% --- Executes during object creation, after setting all properties.function edit2_CreateFcn(hObject, eventdata, handles)% hObject handle to edit2 (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 set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction edit2_Callback(hObject, eventdata, handles)% hObject handle to edit2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit2 as text% str2double(get(hObject,'String')) returns contents of edit2 as a double
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -