当前位置:网站首页>[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 .
边栏推荐
- Tips and extensions of graph theory
- 毕设-基于SSM高校后勤管理系统
- 我年薪100万,全身上下没有超过100块的衣服:存钱,是最顶级的自律
- 八大排序之冒泡、快排、堆排、基数排序
- 营收、利润两位数增长,华润怡宝悄悄打造了这些过亿新品
- Preparation of peptide kc2s modified albumin nanoparticles / targeting peptide GX1 modified human serum albumin nanoparticles probe
- 2022/3/22 examination summary
- 初步了解Panda3D音频和高级交互组件
- 51 MCU internal peripherals: real time clock (SPI)
- Trends in software development in 2022
猜你喜欢

【ELM分类】基于核极限学习机和极限学习机实现UCI数据集分类附matlab代码

AWS DynamoDB运用技巧

营收、利润两位数增长,华润怡宝悄悄打造了这些过亿新品

干货|语义网、Web3.0、Web3、元宇宙这些概念还傻傻分不清楚?(中)
软件测试功能测试全套常见面试题【功能测试】面试总结4-2

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

你想被开除吗?来看看程序员「离职小技巧」吧
Blood spitting finishing nanny level series tutorial - playing Fiddler bag capturing tutorial (5) - detailed explanation of fiddler monitoring panel

Main security risks and Countermeasures of cloud computing services
随机推荐
[noi2018] return (Kruskal reconstruction tree / persistent and search set)
Arm32进行远程调试
Quartus:Instantiation of ‘sdram_ model_ plus‘ failed. The design unit was not found.
Cloudcompare & PCL point cloud equally spaced slices
回Mixlab三天,“创造力团队”治好了我的精神内耗
机器学习项目可视化展示方法
Dry goods semantic web, Web3.0, Web3, metauniverse, these concepts are still confused? (medium)
Helm chart explanation and common commands: helm template / package / plugin
Node red series (30): use persistent UI table to refresh the page without emptying the last table data
VIM editor tutorial
【软考软件评测师】2014综合知识历年真题
China Internet Security Report 2021: API threat soared by more than 200%, and the security risk of software supply chain increased
Do you want to be dismissed? Let's take a look at the "exit tips" of programmers
Cloudcompare & PCL platform convex hull method to calculate crown volume
Main security risks and Countermeasures of cloud computing services
Pyqt5 rapid development and practice 4.10 window drawing controls
Security-001
Visual display method of machine learning project
Basic lighting of unity
在所有浏览器中禁用带有元 HTML 标记的缓存