The use of MATLAB image of the fog operation, on-line search, this aspect of a lot of things, seems to have become a direction of research, Daniel!
Here just give a code, can achieve the image of the fog operation, a detailed look at the back there is no time, want to study their own research.
function darktest (filename)% shadow de-fog algorithm%filename------file name or absolute path to file% Usage: darktest (' 7.png ') close allclcw0=0.65; %0. The multiplication factor is used to retain some fog, 1 o'clock completely de-fog t0=0.1;i=imread (filename), Figure;set (GCF, ' outerposition ', get (0, ' screensize ')); Subplot (221) imshow (I); title (' Original image '); [H,w,s]=size (I); Min_i=zeros (h,w); % get shadow Channel image for I=1:h for j=1:w dark_i (i,j) =min (i (i,j,:)); Endendsubplot (223) imshow (dark_i); title (' Dark Channnel graph '); Max_dark_channel=double (Max (max (dark_i))) % Sky Brightness dark_channel=double (dark_i); t=1-w0* (Dark_channel/max_dark_ Channel); % obtained subplot (224) t=uint8 (t*255), Imshow (t), title (' Graph of transmittance T '); T=max (t,t0);%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%i1=double (I); J (:,:, 1) = Uint8 ((I1 (:,:, 1)-(1-T) *max_dark_channel)./t); J (:,:, 2) = Uint8 ((I1 (:,:, 2)-(1-T) *max_dark_channel)./t); J (:,:, 3) =uint8 ((I1 (:,: 3)-(1-T) *max_dark_channel)./t); subplot (222) Imshow (j); title (' Image after Fog '); end
the effect is as follows:
Matlab image processing _ de-fog algorithm