1 简介

基于图像直方图+滤波处理Matlab代码

2 部分代码

function varargout = mygui(varargin)

% MYGUI MATLAB code for mygui.fig

%      MYGUI, by itself, creates a new MYGUI or raises the existing

%      singleton*.

%

%      H = MYGUI returns the handle to a new MYGUI or the handle to

%      the existing singleton*.

%

%      MYGUI('CALLBACK',hObject,eventData,handles,...) calls the local

%      function named CALLBACK in MYGUI.M with the given input arguments.

%

%      MYGUI('Property','Value',...) creates a new MYGUI or raises the

%      existing singleton*.  Starting from the left, property value pairs are

%      applied to the GUI before mygui_OpeningFcn gets called.  An

%      unrecognized property name or invalid value makes property application

%      stop.  All inputs are passed to mygui_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 mygui


% Last Modified by GUIDE v2.5 04-May-2018 10:20:34


% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;

gui_State = struct('gui_Name',       mfilename, ...

                   'gui_Singleton',  gui_Singleton, ...

                   'gui_OpeningFcn', @mygui_OpeningFcn, ...

                   'gui_OutputFcn',  @mygui_OutputFcn, ...

                   'gui_LayoutFcn',  [] , ...

                   'gui_Callback',   []);

if nargin && ischar(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 mygui is made visible.

function mygui_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 mygui (see VARARGIN)


% Choose default command line output for mygui

handles.output = hObject;

set(handles.axes3,'Visible','off');

set(handles.axes2,'Visible','off');

set(handles.axes4,'Visible','off');

set(handles.axes5,'Visible','off');

set(handles.axes6,'Visible','off');

set(handles.axes7,'Visible','off');

set(handles.axes9,'Visible','off');

set(handles.text9,'Visible','off');

set(handles.text4,'Visible','off');

set(handles.text6,'Visible','off');

set(handles.text7,'Visible','off');

set(handles.text8,'Visible','off');

set(handles.text10,'Visible','off');

set(handles.text11,'Visible','off');

% Update handles structure

guidata(hObject, handles);


% UIWAIT makes mygui wait for user response (see UIRESUME)

% uiwait(handles.figure1);



 imhist(xn);

 set(handles.text9,'Visible','on');

 set(handles.text11,'String',sprintf('改变后图像最大值:%f 最小值:%f\n',max(max(xn)),min(min(xn))));

   set(handles.text10,'String',sprintf('改变后均值:%f  方差:%f',mean2(c),std2(c)*std2(c)));

set(handles.text10,'Visible','on');

set(handles.text11,'Visible','on');

    guidata(hObject, handles);



% --- Executes during object creation, after setting all properties.

function text5_CreateFcn(hObject, eventdata, handles)

% hObject    handle to text5 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    empty - handles not created until after all CreateFcns called



% --- Executes during object creation, after setting all properties.

function axes9_CreateFcn(hObject, eventdata, handles)

% hObject    handle to axes9 (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 populate axes9



% --- Executes during object creation, after setting all properties.

function axes4_CreateFcn(hObject, eventdata, handles)

% hObject    handle to axes4 (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 populate axes4

3 仿真结果

【图像处理】基于图像直方图+滤波处理Matlab代码_图像直方图

4 参考文献

[1]袁兴起, & 韩键美. (2011). 一种基于Matlab的图像滤波算法的设计与实现. 全国测控,计量,仪器仪表学术会议暨中国仪器仪表与测控技术大会.

部分理论引用网络文献,若有侵权联系博主删除。

【图像处理】基于图像直方图+滤波处理Matlab代码_参考文献_02