clc;
clear;
Dir1 = dir(['data/']);
for kk = 3:size(Dir1,1)
mkdir(['output/',Dir1(kk,1).name]);
Dir = dir(['data/',Dir1(kk,1).name,'/*.jpg']);
for k = 1:size(Dir,1)
Org = imread(['data/',Dir1(kk,1).name,'/',Dir(k,1).name]);
Org = imadjust(Org,[0.2 1],[]);
I = rgb2gray(Org);
se = strel('ball',25,25);
map=imdilate(I,se);
map = double(map);
map = (map - min(min(map))) ./ (max(max(map))-min(min(map))+eps);
% figure(2); imshow(map,[]);
% figure(3); imshow(I,[]);
I = double(I) .* (1-log(map+1)*0.4);
I = uint8(I);
%
clear;
Dir1 = dir(['data/']);
for kk = 3:size(Dir1,1)
mkdir(['output/',Dir1(kk,1).name]);
Dir = dir(['data/',Dir1(kk,1).name,'/*.jpg']);
for k = 1:size(Dir,1)
Org = imread(['data/',Dir1(kk,1).name,'/',Dir(k,1).name]);
Org = imadjust(Org,[0.2 1],[]);
I = rgb2gray(Org);
se = strel('ball',25,25);
map=imdilate(I,se);
map = double(map);
map = (map - min(min(map))) ./ (max(max(map))-min(min(map))+eps);
% figure(2); imshow(map,[]);
% figure(3); imshow(I,[]);
I = double(I) .* (1-log(map+1)*0.4);
I = uint8(I);
%