Coverage for src/bob/bio/vein/config/principal_curvature.py: 0%
21 statements
« prev ^ index » next coverage.py v7.6.0, created at 2024-07-12 23:27 +0200
« prev ^ index » next coverage.py v7.6.0, created at 2024-07-12 23:27 +0200
1#!/usr/bin/env python
2# vim: set fileencoding=utf-8 :
3# Tue 27 Sep 2016 16:48:16 CEST
5"""Huang's Principal Curvature extractor and Miura Matching baseline
7References:
91. [HDLTL10]_
102. [TV13]_
113. [TVM14]_
13"""
15from bob.bio.vein.preprocessor import (
16 HuangNormalization,
17 NoCrop,
18 NoFilter,
19 Preprocessor,
20 TomesLeeMask,
21)
23legacy_preprocessor = Preprocessor(
24 crop=NoCrop(),
25 mask=TomesLeeMask(),
26 normalize=HuangNormalization(),
27 filter=NoFilter(),
28)
29"""Preprocessing using gray-level based finger cropping and no post-processing
30"""
33from bob.bio.vein.extractor import PrincipalCurvature
35legacy_extractor = PrincipalCurvature()
38from sklearn.pipeline import make_pipeline
40from bob.bio.base.transformers import (
41 ExtractorTransformer,
42 PreprocessorTransformer,
43)
44from bob.pipelines import wrap
46transformer = make_pipeline(
47 wrap(["sample"], PreprocessorTransformer(legacy_preprocessor)),
48 wrap(["sample"], ExtractorTransformer(legacy_extractor)),
49)
52from bob.bio.vein.algorithm import MiuraMatch
54"""Miura-matching algorithm with specific settings for search displacement
56Defaults taken from [TV13]_.
57"""
59import os
60import tempfile
62sub_directory = "pc"
64default_temp = (
65 os.path.join("/idiap", "temp", os.environ["USER"])
66 if "USER" in os.environ
67 else "~/temp"
68)
70if os.path.exists(default_temp):
71 legacy_temp_dir = os.path.join(
72 default_temp, "bob_bio_base_tmp", sub_directory
73 )
74else:
75 # if /idiap/temp/<USER> does not exist, use /tmp/tmpxxxxxxxx
76 legacy_temp_dir = tempfile.TemporaryDirectory().name
79from bob.bio.base.pipelines import PipelineSimple
81biometric_algorithm = MiuraMatch(ch=18, cw=28)
83pipeline = PipelineSimple(transformer, biometric_algorithm)