lbp.py 1.08 KB
Newer Older
Pedro TOME's avatar
Pedro TOME committed
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
40
41
42
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <Pedro.Tome@idiap.ch>

import bob.fingervein

# Parameters

BLOCK_SIZE = 59    # one or two parameters for block size
BLOCK_OVERLAP = 15 # one or two parameters for block overlap


# LBP parameters
LBP_RADIUS = 16
LBP_NEIGHBOR_COUNT = 16
LBP_UNIFORM = True
LBP_CIRCULAR = True
LBP_ROTATION_INVARIANT = False
LBP_COMPARE_TO_AVERAGE = False
LBP_ADD_AVERAGE = False
# histogram options
SPARSE_HISTOGRAM = False
SPLIT_HISTOGRAM = None
      


#Define feature extractor
feature_extractor = bob.fingervein.features.LocalBinaryPatterns(
  block_size = BLOCK_SIZE,    # one or two parameters for block size
  block_overlap = BLOCK_OVERLAP, # one or two parameters for block overlap
  lbp_radius = LBP_RADIUS,
  lbp_neighbor_count = LBP_NEIGHBOR_COUNT,
  lbp_uniform = LBP_UNIFORM,
  lbp_circular = LBP_CIRCULAR,
  lbp_rotation_invariant = LBP_ROTATION_INVARIANT,
  lbp_compare_to_average = LBP_COMPARE_TO_AVERAGE,
  lbp_add_average = LBP_ADD_AVERAGE,
  # histogram options
  sparse_histogram = SPARSE_HISTOGRAM,
  split_histogram = SPLIT_HISTOGRAM
)