糖尿病康复,内容丰富有趣,生活中的好帮手!
糖尿病康复 > 基于matlab GUI均值+中值+空间+高斯滤波图像去噪

基于matlab GUI均值+中值+空间+高斯滤波图像去噪

时间:2023-12-09 13:34:43

相关推荐

基于matlab GUI均值+中值+空间+高斯滤波图像去噪

基于matlab GUI均值+中值+空间+高斯滤波图像去噪

一、简介

基于matlab GUI均值+中值+空间+高斯滤波图像去噪

二、源代码

% --- 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';'*.jpeg'},'选择图像');%将im定义成全局变量,这样在代码的任何位置都可以使用im了。global im;%如果没有输入路径,则弹出错误对话框if isequal(filename,0)||isequal(pathname,0)errordlg('您还没有选取图片!!','程序员哥哥告诉你');return;else%合成路径+文件名image=[pathname,filename];%读取图像im=imread(image);%打开坐标,方便操作set(handles.axes1,'HandleVisibility','ON');%使用图像,操作在坐标axes1里axes(handles.axes1);%在坐标图axes1里显示原图像imshow(im);title('原始图像');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 = cellstr(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 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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');end% --- Executes on button press in radiobutton1.function radiobutton1_Callback(hObject, eventdata, handles)global gs;global jy;global zs;global ps;jy=0;gs=1;zs=0;ps=0;% hObject handle to radiobutton1 (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 radiobutton1% --- Executes on button press in radiobutton2.function radiobutton2_Callback(hObject, eventdata, handles)global gs;global jy;global zs;global ps;jy=1;gs=0;zs=0;ps=0;% hObject handle to radiobutton2 (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 radiobutton2% --- Executes on button press in radiobutton3.function radiobutton3_Callback(hObject, eventdata, handles)global gs;global jy;global zs;global ps;jy=0;gs=0;zs=1;ps=0;% hObject handle to radiobutton3 (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 radiobutton3% --- 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 = cellstr(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 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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');end% --- Executes on button press in radiobutton4.function radiobutton4_Callback(hObject, eventdata, handles)% hObject handle to radiobutton4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global zzl;global jzl;global kjl;global gsl;jzl=1;zzl=0;kjl=0;gsl=0;% Hint: get(hObject,'Value') returns toggle state of radiobutton4% --- Executes on button press in radiobutton5.function radiobutton5_Callback(hObject, eventdata, handles)% hObject handle to radiobutton5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global zzl;global jzl;global kjl;global gsl;jzl=0;zzl=1;kjl=0;gsl=0;% Hint: get(hObject,'Value') returns toggle state of radiobutton5

三、运行结果

如果觉得《基于matlab GUI均值+中值+空间+高斯滤波图像去噪》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。