Last change
on this file since 66 was
40,
checked in by dtax, 12 years ago
|
HEp 2 cell classification, ICPR 2012 competition
|
File size:
1.3 KB
|
Rev | Line | |
---|
[40] | 1 | % generate a mil dataset from cells |
---|
| 2 | clear all;load cells_gabor; |
---|
| 3 | |
---|
| 4 | delta = 5; % how fine to sample the image |
---|
| 5 | |
---|
| 6 | N = size(x,1); |
---|
| 7 | bags = cell(N,1); |
---|
| 8 | lab = []; |
---|
| 9 | imlab = []; |
---|
| 10 | for 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 |
---|
| 29 | end |
---|
| 30 | a = genmil(bags,strvcat(lab)); |
---|
| 31 | a = setident(a,imlab,'image'); |
---|
| 32 | |
---|
| 33 | M = size(z,1); |
---|
| 34 | bags = cell(M,1); |
---|
| 35 | lab = []; |
---|
| 36 | imlab = []; |
---|
| 37 | for 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 |
---|
| 56 | end |
---|
| 57 | b = genmil(bags,strvcat(lab)); |
---|
| 58 | b = setident(b,imlab,'image'); |
---|
| 59 | |
---|
| 60 | save cellsmil_delta5 a b; |
---|
| 61 | |
---|
Note: See
TracBrowser
for help on using the repository browser.