当前位置:网站首页>[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-28 02:45:00 【matlab_ dingdang】
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 .
边栏推荐
- [TA frost wolf \u may - hundred people plan] Figure 3.7 TP (d) r architecture of mobile terminal
- Today in history: the father of database passed away; Apple buys cups code; IBM chip Alliance
- Eredi reappeared at the digital China Summit and continued to deepen the protection of green waters and mountains with science and technology
- 【LeetCode】13. Linked List Cycle·环形链表
- 【信号处理】基于高阶统计量特征的通信系统中微弱信号检测附matlab代码
- 【HCIP】路由策略、策略路由
- mysql 如图所示,现有表a,表b,需求为 通过projectcode关联a、b表,查出address不同的 idcardnum。
- ERD online 4.0.0 free private deployment scheme
- [tutorial of using idea] shortcut key of idea
- Representation of children and brothers of trees
猜你喜欢

Interviewer: what is the factory method mode?

Email security report in the second quarter: email attacks have soared fourfold, and well-known brands have been used to gain trust

Canvas from getting started to persuading friends to give up (graphic version)

Compile and use Qwt in qt|vs2017
![[software testing] - unittest framework for automated testing](/img/7a/29b222cb0b6a5953b98f8d797cd106.png)
[software testing] - unittest framework for automated testing

Cesium3Dtilesets 使用customShader的解读以及泛光效果示例

Four methods of modifying MySQL password (suitable for beginners)

【LeetCode】13. Linked List Cycle·环形链表

Maskedauutoencoders visual learner cvpr2022

How to simply realize the function of menu dragging and sorting
随机推荐
Smart contract security -- selfdestroy attack
Canvas 从入门到劝朋友放弃(图解版)
Please, don't use the command line to configure MySQL master-slave replication. Isn't it fragrant to deploy with urlos interface?
Flask1.1.4 werkzeug1.0.1 source code analysis: Blueprint
Typescript (zero) -- introduction, environment construction, first instance
Notes for the fourth time of first knowing C language
LETV responded that employees live an immortal life without internal problems and bosses; Apple refuses to store user icloud data in Russia; Dapr 1.8.0 release | geek headlines
retainface使用报错:ModuleNotFoundError: No module named 'rcnn.cython.bbox'
Find - block search
pytorch优化器设置
pytest最好的测试框架
Representation of children and brothers of trees
windbg
程序里随处可见的interface,真的有用吗?真的用对了吗?
修改MySQL密码的四种方法(适合初学者)
Which users are suitable for applying for rapidssl certificate
Necessary knowledge points of the original group
Today in history: the father of database passed away; Apple buys cups code; IBM chip Alliance
Special network technology virtual host PHP version setting
Deep understanding of recursion