-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtestField.m
55 lines (33 loc) · 1000 Bytes
/
testField.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
NAME = '000373.jpg';
LABEL = "Labels/label_" + NAME + ".mat";
LABEL_NUM = "Labels/label_number_" + NAME + ".mat";
PATH_IMG = "Data/" + NAME;
load(LABEL);
load(LABEL_NUM);
I_ORG = imread(PATH_IMG{1});
I = im2double(I_ORG);
labels = labels + 1;
testRes = getLabelGraph(labels, numlabels);
%
% Iclone = I;
% [rC,cC, ~] = size(I);
%
% for r=1:rC
% for c=1:cC
% tmp = result{labels(r,c)+1};
% Iclone(r,c,1) = tmp(1,1) / 256;
% Iclone(r,c,2) = tmp(1,2) / 256;
% Iclone(r,c,3) = tmp(1,3) / 256;
% end
% end
iterationCount = ceil(numlabels - 3 );
[resultSet,scores] = mergeAll(I,labels,numlabels , iterationCount);
sorted = sort(scores{1,1},'descend');
bbs = cell(1,3);
for k = 1:3
s = sorted(1,k);
ind = find(scores{1,1} == s);
bbs{1,k} = visualizeSet(I_ORG , labels, scores{1,2}{1,ind});
end
%imshow(Iclone);
%figure; plot(testRes,'NodeLabel', testRes.Nodes.Name);