Log4j.xml how to output only log.debugcal

2023-01-23   ES  

img_name=’333.jpg’;
% original image
I=double(imread(img_name))/255;

% Get the image size

[h,w,c]=size(I);
win_size = 7;
img_size=w*h;
dehaze=zeros(img_size*c,1);
dehaze=reshape(dehaze,h,w,c);

figure, imshow(I);
win_dark=zeros(img_size ,1);

for cc=1:img_size
   win_dark(cc)=1;
end

win_dark=reshape(win_dark,h,w);
%Calculate block darkchaannel
 for j=1+win_size:w-win_size
    for i=win_size+1:h-win_size
        m_pos_min = min(I(i,j,:));
        for n=j-win_size:j+win_size
            for m=i-win_size:i+win_size
                if(win_dark(m,n)>m_pos_min)
                    win_dark(m,n)=m_pos_min;
                end
            end
        end
       
    end
 end
 
 figure, imshow(win_dark);
 
 for cc=1:img_size
   win_dark(cc)=1-win_dark(cc);
 end
%Select precision DARK VALUE coordinates
win_b = zeros(img_size,1);
 
for ci=1:h
    for cj=1:w
        if(rem(ci-8,15)<1)
if (Rem (CJ-8, 15) <1) %The purpose of doing this is-get sparse dots in the full matrix-evenly distributed in the matrix
                win_b(ci*w+cj)=win_dark(ci*w+cj);
            end
        end
       
    end
end
 
%Display block darkchaannel
%figure, imshow(win_dark);
neb_size = 9;
win_size = 1;
epsilon = 0.0000001;
%Specify matrix shape
indsM=reshape([1:img_size],h,w);
%Calculating matrix L
tlen = img_size*neb_size^2;
row_inds=zeros(tlen ,1);
col_inds=zeros(tlen,1);
vals=zeros(tlen,1);
len=0;
for j=1+win_size:w-win_size
    for i=win_size+1:h-win_size
        if(rem(ci-8,15)<1)
            if(rem(cj-8,15)<1)
                continue;
            end
        end
      win_inds=indsM(i-win_size:i+win_size,j-win_size:j+win_size);
win_inds = win_inds (:);%column display
      winI=I(i-win_size:i+win_size,j-win_size:j+win_size,:);
wini = reshape (wini, neb_size, c); %of the three channels are pulled to become a two -dimensional matrix 3*9
win_mu = mean (wini, 1) ‘; %find the average value of each column If the second parameter is 2, the average value of each line // matrix variable vector
win_var = INV (wini ‘*wini/neb_size-win_mu*win_mu’ +epsilon/neb_size*eye (c)); %

WINI = WINI-REPMAT (win_mu ‘, neb_size, 1);%
TVALS = (1+Wini*Win_var*Wini ‘)/NEB_SIZE;% Seeking the matrix L

      row_inds(1+len:neb_size^2+len)=reshape(repmat(win_inds,1,neb_size),…
                                             neb_size^2,1);
      col_inds(1+len:neb_size^2+len)=reshape(repmat(win_inds’,neb_size,1),…
                                             neb_size^2,1);
      vals(1+len:neb_size^2+len)=tvals(:);
      len=len+neb_size^2;
    end
end

vals=vals(1:len);
row_inds=row_inds(1:len);
col_inds=col_inds(1:len);
%Create a sparse matrix
A=sparse(row_inds,col_inds,vals,img_size,img_size);
%of the total and SUMA as the column vector
sumA=sum(A,2);
%SPDIAGS (Suma (:), 0, IMG_SIZE, IMG_SIZE) Create IMG_SIZE Size Small Small Element. The element is placed on the diagonal position specified by 0.
A=spdiags(sumA(:),0,img_size,img_size)-A;

%Create a sparse matrix
  D=spdiags(win_b(:),0,img_size,img_size);
  lambda=1;
  x=(A+lambda*D)/(lambda*win_b(:).*win_b(:));
 
%Remove the number other than 0-1
   alpha=max(min(reshape(x,h,w),1),0);
 

figure, imshow(alpha);
a = 220/255; %atmospheric light is not calculated
%to fog
       
for i=1:c
    for j=1:h
        for l=1:w
            dehaze(j,l,i)=(I(j,l,i)-A)/alpha(j,l)+A;
        end
    end
end

figure, imshow(dehaze);

source

Related Posts

, 1 1 1 1

POI import Excel analysis of various format unit grid public methods for finishing

32 and 64 -bit systems (Int Char Long Double pointer, etc.)

Far -range server or Linux system configures the TOMCAT administrator permissions

Log4j.xml how to output only log.debugcal

Random Posts

JENKINS Local Publisher Sweet SHE

How to guide the high -definition diagram of Matlab/Simulink simulation box (vector map)

A dynamic array automatic matching value-from the middle school of “Embedded Hodgepodge”

shiro-multi-realm verification

Unity editor expand nine -delete the lost script in the scene