Skip to content
Snippets Groups Projects
Commit 05980774 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Set better defaults and use them on stock configuration

parent ccf7e54c
No related branches found
No related tags found
1 merge request!353DFV and multiple fixes
...@@ -47,8 +47,8 @@ class MiuraMatch (Algorithm): ...@@ -47,8 +47,8 @@ class MiuraMatch (Algorithm):
""" """
def __init__(self, def __init__(self,
ch = 8, # Maximum search displacement in y-direction ch = 80, # Maximum search displacement in y-direction
cw = 5, # Maximum search displacement in x-direction cw = 90, # Maximum search displacement in x-direction
): ):
# call base class constructor # call base class constructor
......
...@@ -20,30 +20,20 @@ or the attribute ``sub_directory`` in a configuration file loaded **after** ...@@ -20,30 +20,20 @@ or the attribute ``sub_directory`` in a configuration file loaded **after**
this resource. this resource.
""" """
from ..preprocessor import NoCrop, Padder, TomesLeeMask, \ from ..preprocessor import NoCrop, TomesLeeMask, HuangNormalization, \
HuangNormalization, NoFilter, Preprocessor 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
preprocessor = Preprocessor( preprocessor = Preprocessor(
crop=NoCrop(), crop=NoCrop(),
mask=TomesLeeMask(filter_height=FILTER_HEIGHT, filter_width=FILTER_WIDTH, mask=TomesLeeMask(),
padder=Padder(padding_width=PAD_WIDTH, padding_constant=PAD_CONST)), normalize=HuangNormalization(),
normalize=HuangNormalization(padding_width=PAD_WIDTH,
padding_constant=PAD_CONST),
filter=NoFilter(), filter=NoFilter(),
) )
"""Preprocessing using gray-level based finger cropping and no post-processing """Preprocessing using gray-level based finger cropping and no post-processing
""" """
from ..extractor import MaximumCurvature from ..extractor import MaximumCurvature
extractor = MaximumCurvature(sigma = 5) extractor = MaximumCurvature()
"""Features are the output of the maximum curvature algorithm, as described on """Features are the output of the maximum curvature algorithm, as described on
[MNM05]_. [MNM05]_.
...@@ -53,7 +43,7 @@ Defaults taken from [TV13]_. ...@@ -53,7 +43,7 @@ Defaults taken from [TV13]_.
# Notice the values of ch and cw are different than those from the # Notice the values of ch and cw are different than those from the
# repeated-line tracking baseline. # repeated-line tracking baseline.
from ..algorithm import MiuraMatch from ..algorithm import MiuraMatch
algorithm = MiuraMatch(ch=80, cw=90) algorithm = MiuraMatch()
"""Miura-matching algorithm with specific settings for search displacement """Miura-matching algorithm with specific settings for search displacement
Defaults taken from [TV13]_. Defaults taken from [TV13]_.
......
...@@ -20,23 +20,13 @@ or the attribute ``sub_directory`` in a configuration file loaded **after** ...@@ -20,23 +20,13 @@ or the attribute ``sub_directory`` in a configuration file loaded **after**
this resource. this resource.
""" """
from ..preprocessor import NoCrop, Padder, TomesLeeMask, \ from ..preprocessor import NoCrop, TomesLeeMask, HuangNormalization, \
HuangNormalization, NoFilter, Preprocessor 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
preprocessor = Preprocessor( preprocessor = Preprocessor(
crop=NoCrop(), crop=NoCrop(),
mask=TomesLeeMask(filter_height=FILTER_HEIGHT, filter_width=FILTER_WIDTH, mask=TomesLeeMask(),
padder=Padder(padding_width=PAD_WIDTH, padding_constant=PAD_CONST)), normalize=HuangNormalization(),
normalize=HuangNormalization(padding_width=PAD_WIDTH,
padding_constant=PAD_CONST),
filter=NoFilter(), filter=NoFilter(),
) )
"""Preprocessing using gray-level based finger cropping and no post-processing """Preprocessing using gray-level based finger cropping and no post-processing
...@@ -44,21 +34,7 @@ preprocessor = Preprocessor( ...@@ -44,21 +34,7 @@ preprocessor = Preprocessor(
from ..extractor import RepeatedLineTracking from ..extractor import RepeatedLineTracking
# Maximum number of iterations extractor = RepeatedLineTracking()
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
)
"""Features are the output of repeated-line tracking, as described on [MNM04]_. """Features are the output of repeated-line tracking, as described on [MNM04]_.
Defaults taken from [TV13]_. Defaults taken from [TV13]_.
......
...@@ -20,23 +20,13 @@ or the attribute ``sub_directory`` in a configuration file loaded **after** ...@@ -20,23 +20,13 @@ or the attribute ``sub_directory`` in a configuration file loaded **after**
this resource. this resource.
""" """
from ..preprocessor import NoCrop, Padder, TomesLeeMask, \ from ..preprocessor import NoCrop, TomesLeeMask, HuangNormalization, \
HuangNormalization, NoFilter, Preprocessor 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
preprocessor = Preprocessor( preprocessor = Preprocessor(
crop=NoCrop(), crop=NoCrop(),
mask=TomesLeeMask(filter_height=FILTER_HEIGHT, filter_width=FILTER_WIDTH, mask=TomesLeeMask(),
padder=Padder(padding_width=PAD_WIDTH, padding_constant=PAD_CONST)), normalize=HuangNormalization(),
normalize=HuangNormalization(padding_width=PAD_WIDTH,
padding_constant=PAD_CONST),
filter=NoFilter(), filter=NoFilter(),
) )
"""Preprocessing using gray-level based finger cropping and no post-processing """Preprocessing using gray-level based finger cropping and no post-processing
...@@ -44,20 +34,7 @@ preprocessor = Preprocessor( ...@@ -44,20 +34,7 @@ preprocessor = Preprocessor(
from ..extractor import WideLineDetector from ..extractor import WideLineDetector
# Radius of the circular neighbourhood region extractor = WideLineDetector()
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
)
"""Features are the output of the maximum curvature algorithm, as described on """Features are the output of the maximum curvature algorithm, as described on
[HDLTL10]_. [HDLTL10]_.
......
...@@ -213,7 +213,7 @@ class KonoMask(Masker): ...@@ -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.sigma = sigma
self.padder = padder self.padder = padder
...@@ -314,7 +314,7 @@ class LeeMask(Masker): ...@@ -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_height = filter_height
self.filter_width = filter_width self.filter_width = filter_width
self.padder = padder self.padder = padder
...@@ -403,7 +403,7 @@ class TomesLeeMask(Masker): ...@@ -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_height = filter_height
self.filter_width = filter_width self.filter_width = filter_width
self.padder = padder self.padder = padder
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment