-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcalculateIDTall.m
53 lines (39 loc) · 1.59 KB
/
calculateIDTall.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
%
binfvec = loadImages('Images/Black/Cortadas');
imvec = loadImages('Images/Photo1/Cortadas');
% [r c ] = generateValid(imvec,binfvec,1);
% validPosR = [];
% validPosR(:,1) =r;
% validPosR(:,2) =c;
% [r c ] = generateValid(imvec,binfvec,2);
% validPosG = [];
% validPosG(:,1) =r;
% validPosG(:,2) =c;
% [r c ] = generateValid(imvec,binfvec,3);
% validPosB = [];
% validPosB(:,1) =r;
% validPosB(:,2) =c;
% showPos(imvec{1},validPos(:,1),validPos(:,2));
% turbidant = turbidityEst2(imvec{1},imvec{7},binfvec{7});
% turbid = turbidityEst2(imvec{1},imvec{8},binfvec{8});
% tImage = turbidant./turbid;
% validPos = uniRan(tImage,vector);
% validPos = vector;
x = [0];
SDIvec = 0;
Iim= imvec{1};
distance = 0.58;
dmapR = calculateDmap(Iim(:,:,1),distance);
[I, spImage] = spAverageImageGray(imvec{1},164);
[dmap] = spAverageImageWSpImageGray(dmapR,spImage);
for i=2:length(imvec)
%SDIvec = [ SDIvec ,100 * floor((1- ssim_index(rgb2gray(imvec{1}),rgb2gray(imvec{i})))*10000)/10000];
Binf = binfvec{i};
BinfR= imresize(Binf, size(Iim));
%BinfR(:,:,2) = imresize(Binf(:,:,2), size(Iim(:,:,2)));
%BinfR(:,:,3) = imresize(Binf(:,:,3), size(Iim(:,:,3)));
[Binf ] = spAverageImageWSpImageGray(BinfR,spImage);
[J] = spAverageImageWSpImageGray(imvec{i}, spImage);
%[J, spImage] = spAverageImage(imvec{i} ,96);
x= [ x, estimateIDT(J,I,Binf,dmap,i,spImage)];
end