-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathloadImages.m
executable file
·69 lines (51 loc) · 1.87 KB
/
loadImages.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
function imvec = loadImages(path)
pngFiles = dir(strcat(path,'/*.jpg'));
%imvec = zeros(size()
imvec{length(pngFiles)} = 1;
for k = 12:12
filename = pngFiles(k).name;
[I, MAP] = imread(strcat(path,'/',filename));
%figure; imshow(I);
sigma=5;
window=7;
H = fspecial('gaussian',[round(window*sigma), round(window*sigma)],sigma);
%Ilarge = uint8(zeros(size(I,1)+1,size(I,2)+2));
%Ilarge(1:size(I,1),1:size(I,2)) = I;
I = rgb2gray(I);
J = bfilter2(double(I)/255,5,[3 0.1]);
% Convert indexed image to true-color (RGB) format
%
% RGB=I;
% % Convert image to L*a*b* color space
% cform2lab = makecform('srgb2lab');
% LAB = applycform(RGB, cform2lab);
%
% % Scale values to range from 0 to 1
% L = LAB(:,:,1);%/100;
%
% % Perform CLAHE
% LAB(:,:,1) = adapthisteq(L,'NumTiles',...
% [8 8],'ClipLimit',0.0005);%*100;
%
% % Convert back to RGB color space
% cform2srgb = makecform('lab2srgb');
% J = applycform(LAB, cform2srgb);
% Display the results
%figure, imshow(RGB);
%figure, imshow(J);
%
% J=I;
% %Ilarge = clahs(Ilarge,7,4,'cliplimit',3,'PreserveMaxMin');
% %I = Ilarge(1:size(I,1),1:size(I,2));
% %figure; imshow(I);
% GaussBlur = imfilter(J(:,:,1),H,'same');
% J(:,:,1) = GaussBlur;
% GaussBlur = imfilter(J(:,:,2),H,'same');
% J(:,:,2) = GaussBlur;
% GaussBlur = imfilter(J(:,:,3),H,'same');
% J(:,:,3) = GaussBlur;
%I = imadjust(I);
%figure; imshow(GaussBlur);
imvec{k} = J;
end
end