source: hep2cells/gencellgabor.m @ 43

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

HEp 2 cell classification, ICPR 2012 competition

File size: 1.3 KB
RevLine 
[40]1% load the data:
2load cells;
3
4% settings:
5g_s = [1 2 3 5]; % scale
6g_f = [0.1 0.3]; %freq
7g_d = [0 0.25 0.5 0.75]*pi; % direction
8
9% other
10ns = length(g_s);
11nd = length(g_d);
12nf = length(g_f);
13
14% compute feature for train and test:
15dim = ns*nd*nf;
16N = size(x,1);
17for i=1:N
18   i
19   % get image data from green channel:
20   %im = x{i,1}(:,:,2);
21   im = sum(x{i,1}(:,:,2),3);
22   if (min(im(:))<0)
23      error('pixel values < 0');
24   end
25%   im = im/max(im(:));
26   im = double(hist_equalize(im));
27   %newx:
28   newx = zeros(size(im,1),size(im,2),dim+1);
29   newx(:,:,1) = im;
30   % get gabor features
31   j=1;
32   for i1=1:ns
33      for i2=1:nf
34         for i3=1:nd
35            j=j+1;
36            newx(:,:,j) = abs(gabor(im,g_s(i1),g_f(i2),g_d(i3)));
37         end
38      end
39   end
40   x{i,1} = newx;
41end
42M = size(z,1);
43for i=1:M
44   i
45   % get image data from green channel:
46   %im = z{i,1}(:,:,2);
47   im = sum(z{i,1}(:,:,2),3);
48   if (min(im(:))<0)
49      error('pixel values < 0');
50   end
51%   im = im/max(im(:));
52   im = double(hist_equalize(im));
53   %newz:
54   newz = zeros(size(im,1),size(im,2),dim+1);
55   newz(:,:,1) = im;
56   % get gabor features
57   j=1;
58   for i1=1:ns
59      for i2=1:nf
60         for i3=1:nd
61            j=j+1;
62            newz(:,:,j) = abs(gabor(im,g_s(i1),g_f(i2),g_d(i3)));
63         end
64      end
65   end
66   z{i,1} = newz;
67end
68
69save cells_gabor x z;
Note: See TracBrowser for help on using the repository browser.