function varargout = MainForm(varargin)
% MAINFORM MATLAB code for MainForm.fig
% MAINFORM, by itself, creates a new MAINFORM or raises the existing
% singleton*.
%
% H = MAINFORM returns the handle to a new MAINFORM or the handle to
% the existing singleton*.
%
% MAINFORM('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MAINFORM.M with the given input arguments.
%
% MAINFORM('Property','Value',...) creates a new MAINFORM or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before MainForm_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to MainForm_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 MainForm
% Last Modified by GUIDE v2.5 29-Dec-2013 17:16:36
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @MainForm_OpeningFcn, ...
'gui_OutputFcn', @MainForm_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 MainForm is made visible.
function MainForm_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 MainForm (see VARARGIN)
% Choose default command line output for MainForm
handles.output = hObject;
InitFig(hObject, handles);
handles.Img1 = 0;
handles.Img2 = 0;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes MainForm wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = MainForm_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;
% --------------------------------------------------------------------
function File_Callback(hObject, eventdata, handles)
% hObject handle to File (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function FileOpen_Callback(hObject, eventdata, handles)
% hObject handle to FileOpen (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% 打开
warning off all;
% 载入图像
/*
开发不易,整理也不易,如需要详细的说明文档和程序,以及完整的数据集,训练好的模型,或者进一步开发,
可加作者新联系方式咨询,WX:Q3101759565,QQ:3101759565
*/
% --------------------------------------------------------------------
function HistImg_Callback(hObject, eventdata, handles)
% hObject handle to HistImg (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% 直方图对比
if isequal(handles.Img1, 0)
msgbox('请载入图像!', '提示信息');
return;
end
if isequal(handles.Img2, 0)
msgbox('请进行去雾处理!', '提示信息');
return;
end
figure('Name', '直方图对比', 'NumberTitle', 'Off', ...
'Units', 'Normalized', 'Position', [0.1 0.1 0.5 0.5]);
subplot(2, 2, 1); imshow(handles.Img1); title('原图像', 'FontWeight', 'Bold');
subplot(2, 2, 2); imshow(handles.Img2); title('处理后的图像', 'FontWeight', 'Bold');
Q = rgb2gray(handles.Img1);
W = rgb2gray(handles.Img2);
subplot(2, 2, 3); imhist(Q, 64); title('原灰度直方图', 'FontWeight', 'Bold');
subplot(2, 2, 4); imhist(W, 64); title('处理后的灰度直方图', 'FontWeight', 'Bold');
% --------------------------------------------------------------------
function GlobalHisteq_Callback(hObject, eventdata, handles)
% hObject handle to GlobalHisteq (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if isequal(handles.Img1, 0)
msgbox('请载入图像!', '提示信息');
return;
end
Img2 = RemoveFogByGlobalHisteq(handles.Img1, 0);
axes(handles.axes2); imshow(Img2, []);
handles.Img2 = Img2;
guidata(hObject, handles);
set(handles.textInfo, 'String', ...
'全局直方图均衡化实现图像去雾算法。');
% --------------------------------------------------------------------
function LocalHisteq_Callback(hObject, eventdata, handles)
% hObject handle to LocalHisteq (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
if isequal(handles.Img1, 0)
msgbox('请载入图像!', '提示信息');
return;
end
Img2 = RemoveFogByLocalHisteq(handles.Img1, 0);
axes(handles.axes2); imshow(Img2, []);
handles.Img2 = Img2;
guidata(hObject, handles);
set(handles.textInfo, 'String', ...
'局部直方图均衡化实现图像去雾算法。');
没有合适的资源?快使用搜索试试~ 我知道了~
基于全局直方图处理-局部直方图处理-Retinex图像去雾-图像增强
共5个文件
m:4个
fig:1个
需积分: 5 0 下载量 122 浏览量
2024-03-09
21:52:25
上传
评论
收藏 50KB ZIP 举报
温馨提示
基于全局直方图处理-局部直方图处理-Retinex图像去雾-图像增强
资源推荐
资源详情
资源评论
收起资源包目录
基于直方图优化的图像去雾技术.zip (5个子文件)
基于直方图优化的图像去雾技术
RemoveFogByLocalHisteq.m 773B
RemoveFogByGlobalHisteq.m 550B
MainForm.fig 45KB
RemoveFogByRetinex.m 2KB
MainForm.m 6KB
共 5 条
- 1
资源评论
迪哥_AI_人工智能
- 粉丝: 583
- 资源: 145
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功