Commit 05980774 authored by André Anjos's avatar André Anjos

Set better defaults and use them on stock configuration

parent ccf7e54c
......@@ -47,8 +47,8 @@ class MiuraMatch (Algorithm):
"""
def __init__(self,
ch = 8, # Maximum search displacement in y-direction
cw = 5, # Maximum search displacement in x-direction
ch = 80, # Maximum search displacement in y-direction
cw = 90, # Maximum search displacement in x-direction
):
# call base class constructor
......
......@@ -20,30 +20,20 @@ or the attribute ``sub_directory`` in a configuration file loaded **after**
this resource.
"""
from ..preprocessor import NoCrop, Padder, TomesLeeMask, \
HuangNormalization, NoFilter, Preprocessor
# Filter sizes for the vertical "high-pass" filter
FILTER_HEIGHT = 4
FILTER_WIDTH = 40
# Padding (to create a buffer during normalization)
PAD_WIDTH = 5
PAD_CONST = 51
from ..preprocessor import NoCrop, TomesLeeMask, HuangNormalization, \
NoFilter, Preprocessor
preprocessor = Preprocessor(
crop=NoCrop(),
mask=TomesLeeMask(filter_height=FILTER_HEIGHT, filter_width=FILTER_WIDTH,
padder=Padder(padding_width=PAD_WIDTH, padding_constant=PAD_CONST)),
normalize=HuangNormalization(padding_width=PAD_WIDTH,
padding_constant=PAD_CONST),
mask=TomesLeeMask(),
normalize=HuangNormalization(),
filter=NoFilter(),
)
"""Preprocessing using gray-level based finger cropping and no post-processing
"""
from ..extractor import MaximumCurvature
extractor = MaximumCurvature(sigma = 5)
extractor = MaximumCurvature()
"""Features are the output of the maximum curvature algorithm, as described on
[MNM05]_.
......@@ -53,7 +43,7 @@ Defaults taken from [TV13]_.
# Notice the values of ch and cw are different than those from the
# repeated-line tracking baseline.
from ..algorithm import MiuraMatch
algorithm = MiuraMatch(ch=80, cw=90)
algorithm = MiuraMatch()
"""Miura-matching algorithm with specific settings for search displacement
Defaults taken from [TV13]_.
......
......@@ -20,23 +20,13 @@ or the attribute ``sub_directory`` in a configuration file loaded **after**
this resource.
"""
from ..preprocessor import NoCrop, Padder, TomesLeeMask, \
HuangNormalization, NoFilter, Preprocessor
# Filter sizes for the vertical "high-pass" filter
FILTER_HEIGHT = 4
FILTER_WIDTH = 40
# Padding (to create a buffer during normalization)
PAD_WIDTH = 5
PAD_CONST = 51
from ..preprocessor import NoCrop, TomesLeeMask, HuangNormalization, \
NoFilter, Preprocessor
preprocessor = Preprocessor(
crop=NoCrop(),
mask=TomesLeeMask(filter_height=FILTER_HEIGHT, filter_width=FILTER_WIDTH,
padder=Padder(padding_width=PAD_WIDTH, padding_constant=PAD_CONST)),
normalize=HuangNormalization(padding_width=PAD_WIDTH,
padding_constant=PAD_CONST),
mask=TomesLeeMask(),
normalize=HuangNormalization(),
filter=NoFilter(),
)
"""Preprocessing using gray-level based finger cropping and no post-processing
......@@ -44,21 +34,7 @@ preprocessor = Preprocessor(
from ..extractor import RepeatedLineTracking
# Maximum number of iterations
NUMBER_ITERATIONS = 3000
# Distance between tracking point and cross section of profile
DISTANCE_R = 1
# Width of profile
PROFILE_WIDTH = 21
extractor = RepeatedLineTracking(
iterations=NUMBER_ITERATIONS,
r=DISTANCE_R,
profile_w=PROFILE_WIDTH,
seed=0, #Sets numpy.random.seed() to this value
)
extractor = RepeatedLineTracking()
"""Features are the output of repeated-line tracking, as described on [MNM04]_.
Defaults taken from [TV13]_.
......
......@@ -20,23 +20,13 @@ or the attribute ``sub_directory`` in a configuration file loaded **after**
this resource.
"""
from ..preprocessor import NoCrop, Padder, TomesLeeMask, \
HuangNormalization, NoFilter, Preprocessor
# Filter sizes for the vertical "high-pass" filter
FILTER_HEIGHT = 4
FILTER_WIDTH = 40
# Padding (to create a buffer during normalization)
PAD_WIDTH = 5
PAD_CONST = 51
from ..preprocessor import NoCrop, TomesLeeMask, HuangNormalization, \
NoFilter, Preprocessor
preprocessor = Preprocessor(
crop=NoCrop(),
mask=TomesLeeMask(filter_height=FILTER_HEIGHT, filter_width=FILTER_WIDTH,
padder=Padder(padding_width=PAD_WIDTH, padding_constant=PAD_CONST)),
normalize=HuangNormalization(padding_width=PAD_WIDTH,
padding_constant=PAD_CONST),
mask=TomesLeeMask(),
normalize=HuangNormalization(),
filter=NoFilter(),
)
"""Preprocessing using gray-level based finger cropping and no post-processing
......@@ -44,20 +34,7 @@ preprocessor = Preprocessor(
from ..extractor import WideLineDetector
# Radius of the circular neighbourhood region
RADIUS_NEIGHBOURHOOD_REGION = 5
NEIGHBOURHOOD_THRESHOLD = 1
#Sum of neigbourhood threshold
SUM_NEIGHBOURHOOD = 41
RESCALE = True
extractor = WideLineDetector(
radius=RADIUS_NEIGHBOURHOOD_REGION,
threshold=NEIGHBOURHOOD_THRESHOLD,
g=SUM_NEIGHBOURHOOD,
rescale=RESCALE
)
extractor = WideLineDetector()
"""Features are the output of the maximum curvature algorithm, as described on
[HDLTL10]_.
......
......@@ -213,7 +213,7 @@ class KonoMask(Masker):
"""
def __init__(self, sigma=5, padder=None):
def __init__(self, sigma=5, padder=Padder()):
self.sigma = sigma
self.padder = padder
......@@ -314,7 +314,7 @@ class LeeMask(Masker):
"""
def __init__(self, filter_height = 4, filter_width = 40, padder=None):
def __init__(self, filter_height = 4, filter_width = 40, padder=Padder()):
self.filter_height = filter_height
self.filter_width = filter_width
self.padder = padder
......@@ -403,7 +403,7 @@ class TomesLeeMask(Masker):
"""
def __init__(self, filter_height = 4, filter_width = 40, padder=None):
def __init__(self, filter_height = 4, filter_width = 40, padder=Padder()):
self.filter_height = filter_height
self.filter_width = filter_width
self.padder = padder
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment