File size: 781 Bytes
d4035c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
function feat = gb(conf, I)

if size(I,3) > 1
  I = rgb2gray(I) ;
end

if ~ conf.usePBEdges
  fbr = compute_channels_oe_nms(I) ;
else
  feat = pbEdges(conf, I) ;
  th  = 4 * mod(feat.theta, pi) / pi ;
  i = floor(th) ;
  wi = 1 - (th - i) ;
  j = i + 1 ;
  wj = 1 - wi ;
  i = mod(i,4) + 1 ;
  j = mod(j,4) + 1 ;

  fbr = zeros(size(I,1),size(I,2),4) ;

  fbr=vl_binsum(fbr,wi .* feat.pb,i,3) ;
  fbr=vl_binsum(fbr,wj .* feat.pb,j,3) ;
end

[descrs, frames] = get_descriptors(...
  fbr, ...
  conf.numFeats, ...
  conf.repulsionRadius, ...
  conf.blurRate, ...
  conf.blurBase, ...
  conf.sampleRadii, ...
  conf.numSamplePerRadius) ;

frames = flipud(frames') ;
descrs = [ descrs(:,:,1) descrs(:,:,2) descrs(:,:,3) descrs(:,:,4)]' ;

feat.frames = frames ;
feat.descrs = descrs ;