当前位置:网站首页>[image defogging] image defogging based on dark channel and non-mean filtering with matlab code
[image defogging] image defogging based on dark channel and non-mean filtering with matlab code
2022-07-27 23:26:00 【Matlab scientific research studio】
1 Content introduction
Fog is actually an aerosol composed of tiny droplets of suspended particles in the atmosphere , Often milky white , Its bottom lies on the earth's surface , So it can also be seen as a cloud close to the ground . Mist is not much different from fog , One explanation for it is light fog , Mostly grayish white , Very close to the color of fog . Fog in a broad sense includes fog 、 Haze 、 Sand dust 、 Smoke and other physical phenomena that limit visual effects . Due to the existence of fog , Outdoor image quality is reduced , If you don't deal with , Often can not meet the relevant research 、 Application requirements . Under the influence of fog , Light passing through the surface of an object is absorbed and reflected by particles in the atmosphere , Resulting in poor image quality , The details are vague 、 The color is dim .


2 Simulation code
function varargout = txrh(varargin)% TXRH MATLAB code for txrh.fig% TXRH, by itself, creates a new TXRH or raises the existing% singleton*.%% H = TXRH returns the handle to a new TXRH or the handle to% the existing singleton*.%% TXRH('CALLBACK',hObject,eventData,handles,...) calls the local% function named CALLBACK in TXRH.M with the given input arguments.%% TXRH('Property','Value',...) creates a new TXRH or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before txrh_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to txrh_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 txrh% Last Modified by GUIDE v2.5 22-Apr-2019 21:49:06% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ...'gui_Singleton', gui_Singleton, ...'gui_OpeningFcn', @txrh_OpeningFcn, ...'gui_OutputFcn', @txrh_OutputFcn, ...'gui_LayoutFcn', [] , ...'gui_Callback', []);if nargin && ischar(varargin{1})gui_State.gui_Callback = str2func(varargin{1});endif nargout[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});elsegui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT% --- Executes just before txrh is made visible.function txrh_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 txrh (see VARARGIN)% Choose default command line output for txrhhandles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes txrh wait for user response (see UIRESUME)% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout = txrh_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 structurevarargout{1} = handles.output;% --- 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)global I[filename,pathname]=uigetfile({'*.bmp;*.tif;*.png','(*.bmp;*.jpg;*.gif;*.tif)';'*.bmp','(*.bmp)';'*.jpg','(*.tif)';'*.gif','(*.tif)';},' Open the picture ');if isequal(filename,0)||isequal(pathname,0)%§ìreturn;elseI=imread([pathname,filename]);end% [m,n,l]=size(I1);% Read the picture 1 Show% if l==3% I1=rgb2gray(I1);% endaxes(handles.axes1)imshow(I)title(' Original picture ')% --- Executes on button press in pushbutton2.% --- 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)global I ;% %matlab 2014a% clc;% clear all;% [filename,pathname]=uigetfile({'*.jpg;*.bmp;*.tif;*.png;*.gif','All Image Files';'*.*','All Files'});% I = imread([pathname,filename]);% Read image%% figure;% set(gcf,'outerposition',get(0,'screensize'));% imshow(I);xlabel(' original image ');[h,w,s]=size(I);min_I=zeros(h,w);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Get dark channel imagefor i=1:hfor j=1:wdark_I(i,j)=min(I(i,j,:));endendfigure;imshow(dark_I);xlabel(' Dark channel image ');%imwrite(dark_I,'dark_I.jpg');Max_dark_channel=double(max(max(dark_I))) % Sky brightnessdark_channel=double(0.9*dark_I);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Nonlocal mean filtering% ParametersT=5;h=6.5;t=3;f=1;for t=1:TI0=NLmeans(dark_channel,t,f,h);endfigure; imshow(uint8(I0));xlabel(' Non mean filtered image ')%function edit10_Callback(hObject, eventdata, handles)% hObject handle to edit10 (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 edit10 as text% str2double(get(hObject,'String')) returns contents of edit10 as a double% --- Executes during object creation, after setting all properties.function edit10_CreateFcn(hObject, eventdata, handles)% hObject handle to edit10 (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))set(hObject,'BackgroundColor','white');end
3 Running results


4 reference
[1] Yuan Kai , Wang xiaofeng . An image defogging algorithm combining dark channel and color decay a priori [J]. Modern computers , 2018, No.622(22):36-41.
[2] Wang Hongyu et al . " Image defogging method and system based on dark channel and nonlocal prior .", 2019.
About bloggers : Good at intelligent optimization algorithms 、 Neural networks predict 、 signal processing 、 Cellular automata 、 The image processing 、 Path planning 、 UAV and other fields Matlab Simulation , relevant matlab Code problems can be exchanged by private letter .
Some theories cite network literature , If there is infringement, contact the blogger to delete .
边栏推荐
- 【信号处理】基于高阶统计量特征的通信系统中微弱信号检测附matlab代码
- 怎么使用xshell免费版
- 8000 word explanation of OBSA principle and application practice
- Test article
- Library management system based on SSM framework
- Implicit indicators for evaluating the advantages and disadvantages of automated testing
- 如何快捷地查看H.265视频播放器EasyPlayer的API属性及其使用方法?
- Introduction to the paper | distributed graph simulation
- 测试文章
- Three consecutive high-frequency interview questions of redis online celebrity: cache penetration? Cache breakdown? Cache avalanche?
猜你喜欢

Complete Guide to IOT architecture

The wechat installation package has expanded 575 times in 11 years, and the up owner: "98% of the documents are garbage"; Apple App store was exposed to a large number of pornographic apps; Four techn

iMeta | 国际标准刊号ISSN印刷版正式确认,双ISSN申请完成

【信号去噪】基于卡尔曼滤波实现信号去噪附matlab代码

【图像检测】基于Combined Separability Filter实现鼻孔和瞳孔等圆检测matlab源码

On data management of data warehouse

See how Gan controls the image generation style step by step? Explain the evolution process of stylegan in detail

Process and planned task management

Network development socket and UDP, TCP protocols

网络开发套接字以及UDP、TCP协议
随机推荐
MySQL basic installation and startup
Basic SQL DDL
[noi2018] bubble sort (combination + Cartland number +dp+ tree array)
Security-001
Lanproxy映射本地开发环境
Unity 的基础光照
Cloud native enthusiast weekly: a complete collection of client go examples
Jsonpath: a powerful rule parsing and parameter lookup tool for JSON
测试文章
Harmonyos third operation
初步了解Panda3D音频和高级交互组件
Basic lighting of unity
Cron expression
Basic SQL DQL
8000 word explanation of OBSA principle and application practice
网络开发套接字以及UDP、TCP协议
MySQL的B+Tree索引到底是咋回事?聚簇索引到底是如何长高的?
You don't know about redis. Let me explain the underlying data structure of redis in detail
2022 / 4 / 11 exam summary
Vulnhub range double trouble