lbp.py 1.04 KB
Newer Older
Pedro TOME's avatar
Pedro TOME committed
1 2 3
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :

4
from ...extractors.LocalBinaryPatterns import LocalBinaryPatterns
Pedro TOME's avatar
Pedro TOME committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

# 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
20

Pedro TOME's avatar
Pedro TOME committed
21 22 23 24 25 26
# histogram options
SPARSE_HISTOGRAM = False
SPLIT_HISTOGRAM = None


#Define feature extractor
27 28 29 30 31 32 33 34 35 36
feature_extractor = 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,
Pedro TOME's avatar
Pedro TOME committed
37
  # histogram options
38 39
  sparse_histogram=SPARSE_HISTOGRAM,
  split_histogram=SPLIT_HISTOGRAM
Pedro TOME's avatar
Pedro TOME committed
40
)