-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcalculateturb.m
executable file
·62 lines (45 loc) · 1.55 KB
/
calculateturb.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
%graylast = imvec{6};
%gauss = fspecial('gaussian',10,2);
%graylast = imfilter(graylast,gauss);
%[r c] = Aest(graylast,15);
% Good points for the white box case
%c = [361 462 129 375 759 65 711 175 453]
%r = [284 200 282 69 478 193 335 434 510]
% Good points for the water box case
%
% for i=1:14
% croped = imvec{i};
% imvec{i} = croped(1:300,:,:);
% imwrite(imvec{i},strcat('Images/ExpC2/Cortadas/',int2str(i-1)),'png')
%
% end
%
[r c ] = generateValid(imvec);
vector = [];
vector(:,1) =r;
vector(:,2) =c;
turbidant = turbidityEst2(imvec{1},imvec{2});
turbid = turbidityEst2(imvec{1},imvec{3});
tImage = turbidant./turbid;
validPos = uniRan(tImage,vector);
turbid = turbidant;
% for i=4:4
%showPos(imvec{1},validPos(:,1),validPos(:,2));
%turbid = turbidityEst2(imvec{1},imvec{i});
%tImage = turbidant./turbid;
%figure;
%CS = uniRan(tImage,vector);
%validPos = intersect(validPos,CS,'rows');
%size(tImage)
%size(imvec{i})
%turbid = turbidant;
%x=[x,mean(CS)];
%imshow(tImage);
% end
showPos(imvec{1},validPos(:,1),validPos(:,2));
x = [0];
SDIvec = 0;
for i=2:20
SDIvec = [ SDIvec ,100 * floor((1- ssim_index(rgb2gray(imvec{1}),rgb2gray(imvec{i})))*10000)/10000];
x= [ x, turbidityEst(imvec{1},imvec{i},validPos(:,1),validPos(:,2))];
end