source: hep2cells/gencellgabor.m @ 101

Last change on this file since 101 was 46, checked in by dtax, 12 years ago

Changes....

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