source: hep2cells/gencellmil.m @ 52

Last change on this file since 52 was 40, checked in by dtax, 12 years ago

HEp 2 cell classification, ICPR 2012 competition

File size: 1.3 KB
Line 
1% generate a mil dataset from cells
2clear all;load cells_gabor;
3
4delta = 5; % how fine to sample the image
5
6N = size(x,1);
7bags = cell(N,1);
8lab = [];
9imlab = [];
10for i=1:N
11   i
12   % store in:
13   thisbag = [];
14   % get gabor features
15   gdat = x{i,1};
16   msk = x{i,2};
17   sz = size(gdat);
18   for i1=1:delta:sz(1)
19      for i2=1:delta:sz(2)
20         if (msk(i1,i2)>0)
21            thisbag = [thisbag; squeeze(gdat(i1,i2,:))'];
22         end
23      end
24   end
25   bags{i} = thisbag;
26   %lab{i} = x{i,4};  % label of bag
27   lab = [lab; x{i,4}];
28   imlab = [imlab; repmat(x{i,3},size(thisbag,1),1)];  % original image label
29end
30a = genmil(bags,strvcat(lab));
31a = setident(a,imlab,'image');
32
33M = size(z,1);
34bags = cell(M,1);
35lab = [];
36imlab = [];
37for i=1:M
38   i
39   % store in:
40   thisbag = [];
41   % get gabor features
42   gdat = z{i,1};
43   msk = z{i,2};
44   sz = size(gdat);
45   for i1=1:delta:sz(1)
46      for i2=1:delta:sz(2)
47         if (msk(i1,i2)>0)
48            thisbag = [thisbag; squeeze(gdat(i1,i2,:))'];
49         end
50      end
51   end
52   bags{i} = thisbag;
53   %lab{i} = z{i,4};  % label of bag
54   lab = [lab; z{i,4}];
55   imlab = [imlab; repmat(z{i,3},size(thisbag,1),1)];  % original image label
56end
57b = genmil(bags,strvcat(lab));
58b = setident(b,imlab,'image');
59
60save cellsmil_delta5 a b;
61
Note: See TracBrowser for help on using the repository browser.