diff --git a/README.rst b/README.rst index 97f135e6f8840646f49985c9ae12862ef4df0806..648ca3a2fb235d041a75ffdc5cbbf5bff58b98dc 100644 --- a/README.rst +++ b/README.rst @@ -47,7 +47,8 @@ To achieve this goal, interfaces to some publicly available vein image databases are contained, and default evaluation protocols are defined, e.g.: - UTFVP - University of Twente Finger Vein Database [http://www.sas.ewi.utwente.nl/] -- VERA Finger vein Database [http://www.idiap.ch/scientific-research/resources] +- VERA - Finger vein Database [http://www.idiap.ch/scientific-research/resources] +- PUT - The PUT biometric vein (palm and wrist) recognition dataset [http://biometrics.put.poznan.pl/vein-dataset/] Algorithms @@ -97,7 +98,8 @@ this package using the same installation mechanism. Development ----------- -In order to develop the latest version of this package:: +In order to develop the latest version of this package, install Bob_ as +indicated above. Once that is done, do this:: $ git clone https://gitlab.idiap.ch/biometrc/bob.bio.vein.git $ cd bob.bio.vein diff --git a/bob/bio/vein/algorithms/MiuraMatch.py b/bob/bio/vein/algorithms/MiuraMatch.py index 499d157e7720c65f125b025aeff5161b7233b91d..17068bb7a20b75b29c1c45c8582f86bd78cfc99c 100644 --- a/bob/bio/vein/algorithms/MiuraMatch.py +++ b/bob/bio/vein/algorithms/MiuraMatch.py @@ -47,7 +47,6 @@ class MiuraMatch (Algorithm): """Enrolls the model by computing an average graph for each model""" # return the generated model - #import ipdb; ipdb.set_trace() return numpy.array(enroll_features) diff --git a/bob/bio/vein/extractors/LocalBinaryPatterns.py b/bob/bio/vein/extractors/LocalBinaryPatterns.py index 221580684df540f301d99ff3ef800a6a0bff4cab..c799c56105e49125d3da27aea06a8d866d219bd3 100644 --- a/bob/bio/vein/extractors/LocalBinaryPatterns.py +++ b/bob/bio/vein/extractors/LocalBinaryPatterns.py @@ -80,8 +80,6 @@ class LocalBinaryPatterns (Extractor): """Copies the given array into the given blocks""" # fill array in the desired shape - #For debugging - #import ipdb; ipdb.set_trace() for b in range(self.m_n_blocks): lbphs_array[b * self.m_n_bins : (b+1) * self.m_n_bins] = lbphs_blocks[b][:] @@ -90,9 +88,6 @@ class LocalBinaryPatterns (Extractor): """Computes and returns the LBP features for the given input fingervein image""" - # For debugging - #import ipdb; ipdb.set_trace() - finger_image = finger_image.astype(numpy.float64) finger_mask = numpy.zeros(mask.shape) @@ -113,9 +108,6 @@ class LocalBinaryPatterns (Extractor): # create new array lbphs_array = numpy.zeros(shape, 'float64') - #For debugging - #import ipdb; ipdb.set_trace() - # fill the array with the absolute values of the Gabor wavelet transform self.__fill__(lbphs_array, abs_blocks, 0) diff --git a/bob/bio/vein/extractors/RepeatedLineTracking.py b/bob/bio/vein/extractors/RepeatedLineTracking.py index 4321c9562cf630812a1c84002cf496f03f52fc08..9f87d92a23b20486c6eeff107eb31e6fbaa37284 100644 --- a/bob/bio/vein/extractors/RepeatedLineTracking.py +++ b/bob/bio/vein/extractors/RepeatedLineTracking.py @@ -1,8 +1,9 @@ #!/usr/bin/env python # vim: set fileencoding=utf-8 : -import numpy import math +import numpy +import scipy.ndimage import bob.core import bob.io.base @@ -198,14 +199,6 @@ class RepeatedLineTracking (Extractor): img_veins_bin = img_veins > md img_veins_bin = scipy.ndimage.binary_closing(img_veins_bin, structure=numpy.ones((2,2))).astype(int) - #import ipdb; ipdb.set_trace() - #img_veins_bin2 = scipy.ndimage.binary_closing(img_veins_bin, structure=numpy.ones((2,2))).astype(int) - #from PIL import Image - - #Image.fromarray(bob.core.convert(img_veins_bin,numpy.uint8,(0,255),(0,1))).show() - #skel = self.skeletonize(img_veins_bin2) - #Image.fromarray(bob.core.convert(skel,numpy.uint8,(0,255),(0,1))).show() - return img_veins_bin.astype(numpy.float64) diff --git a/bob/bio/vein/preprocessors/FingerCrop.py b/bob/bio/vein/preprocessors/FingerCrop.py index 218f38aa97e26cbe6dd3c3a91271d2a95c537f3f..4492af76e7f1e4de0b33cbdf9acdaf20b6a11c31 100644 --- a/bob/bio/vein/preprocessors/FingerCrop.py +++ b/bob/bio/vein/preprocessors/FingerCrop.py @@ -329,7 +329,6 @@ class FingerCrop (Preprocessor): def __HE__(self, image): #Umbralization based on the pixels non zero - #import ipdb; ipdb.set_trace() imageEnhance = numpy.zeros(image.shape) imageEnhance = imageEnhance.astype(numpy.uint8) @@ -372,7 +371,6 @@ class FingerCrop (Preprocessor): imageEnhance = utils.imfilter(image, gaborfilter, self.gpu, conv=False) imageEnhance = numpy.abs(imageEnhance) - #import ipdb; ipdb.set_trace() imageEnhance = bob.core.convert(imageEnhance,numpy.uint8,(0,255),(imageEnhance.min(),imageEnhance.max())) return imageEnhance @@ -388,8 +386,6 @@ class FingerCrop (Preprocessor): b = 1.2 n = 2.0 - #import ipdb; ipdb.set_trace() - #Convert image to doubles image_new = bob.core.convert(image,numpy.float64,(0,1),(0,255)) img_h, img_w = image_new.shape @@ -459,7 +455,6 @@ class FingerCrop (Preprocessor): def crop_finger(self, image): spoofingValue = self.__spoofingdetector__(image) - #import ipdb; ipdb.set_trace() #Padding array image = self.__padding_finger__(image) diff --git a/bob/bio/vein/tests/matching/0001_2_1_120509-135338.mat b/bob/bio/vein/tests/algorithms/0001_2_1_120509-135338.mat similarity index 100% rename from bob/bio/vein/tests/matching/0001_2_1_120509-135338.mat rename to bob/bio/vein/tests/algorithms/0001_2_1_120509-135338.mat diff --git a/bob/bio/vein/tests/matching/0001_2_2_120509-135558.mat b/bob/bio/vein/tests/algorithms/0001_2_2_120509-135558.mat similarity index 100% rename from bob/bio/vein/tests/matching/0001_2_2_120509-135558.mat rename to bob/bio/vein/tests/algorithms/0001_2_2_120509-135558.mat diff --git a/bob/bio/vein/tests/matching/0003_2_1_120509-141255.mat b/bob/bio/vein/tests/algorithms/0003_2_1_120509-141255.mat similarity index 100% rename from bob/bio/vein/tests/matching/0003_2_1_120509-141255.mat rename to bob/bio/vein/tests/algorithms/0003_2_1_120509-141255.mat diff --git a/bob/bio/vein/tests/matching/001_L_1.mat b/bob/bio/vein/tests/algorithms/001_L_1.mat similarity index 100% rename from bob/bio/vein/tests/matching/001_L_1.mat rename to bob/bio/vein/tests/algorithms/001_L_1.mat diff --git a/bob/bio/vein/tests/matching/001_L_1_h4w40.mat b/bob/bio/vein/tests/algorithms/001_L_1_h4w40.mat similarity index 100% rename from bob/bio/vein/tests/matching/001_L_1_h4w40.mat rename to bob/bio/vein/tests/algorithms/001_L_1_h4w40.mat diff --git a/bob/bio/vein/tests/features/huangwl_input_fvr.mat b/bob/bio/vein/tests/extractors/huangwl_input_fvr.mat similarity index 100% rename from bob/bio/vein/tests/features/huangwl_input_fvr.mat rename to bob/bio/vein/tests/extractors/huangwl_input_fvr.mat diff --git a/bob/bio/vein/tests/features/huangwl_input_img.mat b/bob/bio/vein/tests/extractors/huangwl_input_img.mat similarity index 100% rename from bob/bio/vein/tests/features/huangwl_input_img.mat rename to bob/bio/vein/tests/extractors/huangwl_input_img.mat diff --git a/bob/bio/vein/tests/features/huangwl_output.mat b/bob/bio/vein/tests/extractors/huangwl_output.mat similarity index 100% rename from bob/bio/vein/tests/features/huangwl_output.mat rename to bob/bio/vein/tests/extractors/huangwl_output.mat diff --git a/bob/bio/vein/tests/features/miuramax_input_fvr.mat b/bob/bio/vein/tests/extractors/miuramax_input_fvr.mat similarity index 100% rename from bob/bio/vein/tests/features/miuramax_input_fvr.mat rename to bob/bio/vein/tests/extractors/miuramax_input_fvr.mat diff --git a/bob/bio/vein/tests/features/miuramax_input_img.mat b/bob/bio/vein/tests/extractors/miuramax_input_img.mat similarity index 100% rename from bob/bio/vein/tests/features/miuramax_input_img.mat rename to bob/bio/vein/tests/extractors/miuramax_input_img.mat diff --git a/bob/bio/vein/tests/features/miuramax_output.mat b/bob/bio/vein/tests/extractors/miuramax_output.mat similarity index 100% rename from bob/bio/vein/tests/features/miuramax_output.mat rename to bob/bio/vein/tests/extractors/miuramax_output.mat diff --git a/bob/bio/vein/tests/features/miurarlt_input_fvr.mat b/bob/bio/vein/tests/extractors/miurarlt_input_fvr.mat similarity index 100% rename from bob/bio/vein/tests/features/miurarlt_input_fvr.mat rename to bob/bio/vein/tests/extractors/miurarlt_input_fvr.mat diff --git a/bob/bio/vein/tests/features/miurarlt_input_img.mat b/bob/bio/vein/tests/extractors/miurarlt_input_img.mat similarity index 100% rename from bob/bio/vein/tests/features/miurarlt_input_img.mat rename to bob/bio/vein/tests/extractors/miurarlt_input_img.mat diff --git a/bob/bio/vein/tests/features/miurarlt_output.mat b/bob/bio/vein/tests/extractors/miurarlt_output.mat similarity index 100% rename from bob/bio/vein/tests/features/miurarlt_output.mat rename to bob/bio/vein/tests/extractors/miurarlt_output.mat diff --git a/bob/bio/vein/tests/preprocessing/0019_3_1_120509-160517.png b/bob/bio/vein/tests/preprocessors/0019_3_1_120509-160517.png similarity index 100% rename from bob/bio/vein/tests/preprocessing/0019_3_1_120509-160517.png rename to bob/bio/vein/tests/preprocessors/0019_3_1_120509-160517.png diff --git a/bob/bio/vein/tests/preprocessing/0019_3_1_120509-160517_fvr_lee_huang.mat b/bob/bio/vein/tests/preprocessors/0019_3_1_120509-160517_fvr_lee_huang.mat similarity index 100% rename from bob/bio/vein/tests/preprocessing/0019_3_1_120509-160517_fvr_lee_huang.mat rename to bob/bio/vein/tests/preprocessors/0019_3_1_120509-160517_fvr_lee_huang.mat diff --git a/bob/bio/vein/tests/preprocessing/0019_3_1_120509-160517_img_lee.mat b/bob/bio/vein/tests/preprocessors/0019_3_1_120509-160517_img_lee.mat similarity index 100% rename from bob/bio/vein/tests/preprocessing/0019_3_1_120509-160517_img_lee.mat rename to bob/bio/vein/tests/preprocessors/0019_3_1_120509-160517_img_lee.mat diff --git a/bob/bio/vein/tests/preprocessing/0019_3_1_120509-160517_img_lee_huang.mat b/bob/bio/vein/tests/preprocessors/0019_3_1_120509-160517_img_lee_huang.mat similarity index 100% rename from bob/bio/vein/tests/preprocessing/0019_3_1_120509-160517_img_lee_huang.mat rename to bob/bio/vein/tests/preprocessors/0019_3_1_120509-160517_img_lee_huang.mat diff --git a/bob/bio/vein/tests/test.py b/bob/bio/vein/tests/test.py index 9622ee8e08d6349a39ad59ef23fd344e26fb4de3..20a5eaf632e1b885028c264d68b68b626401d646 100644 --- a/bob/bio/vein/tests/test.py +++ b/bob/bio/vein/tests/test.py @@ -13,6 +13,7 @@ import pkg_resources import bob.io.base import bob.io.matlab +import bob.io.image def F(parts): @@ -23,17 +24,17 @@ def F(parts): def test_finger_crop(): - #Test finger vein image preprocessing + #Test finger vein image preprocessors - input_filename = F(('preprocessing', '0019_3_1_120509-160517.png')) - output_img_filename = F(('preprocessing', + input_filename = F(('preprocessors', '0019_3_1_120509-160517.png')) + output_img_filename = F(('preprocessors', '0019_3_1_120509-160517_img_lee_huang.mat')) - output_fvr_filename = F(('preprocessing', + output_fvr_filename = F(('preprocessors', '0019_3_1_120509-160517_fvr_lee_huang.mat')) img = bob.io.base.load(input_filename) - from bob.fingervein.preprocessing.FingerCrop import FingerCrop + from bob.bio.vein.preprocessors.FingerCrop import FingerCrop FC = FingerCrop(4, 40, False, False) #FC = FingerCrop(4, 40, False, 5, 0.2, False) @@ -52,16 +53,16 @@ def test_miuramax(): #Maximum Curvature method against Matlab reference - input_img_filename = F(('features', 'miuramax_input_img.mat')) - input_fvr_filename = F(('features', 'miuramax_input_fvr.mat')) - output_filename = F(('features', 'miuramax_output.mat')) + input_img_filename = F(('extractors', 'miuramax_input_img.mat')) + input_fvr_filename = F(('extractors', 'miuramax_input_fvr.mat')) + output_filename = F(('extractors', 'miuramax_output.mat')) # Load inputs input_img = bob.io.base.load(input_img_filename) input_fvr = bob.io.base.load(input_fvr_filename) # Apply Python implementation - from bob.fingervein.features.MaximumCurvature import MaximumCurvature + from bob.bio.vein.extractors.MaximumCurvature import MaximumCurvature MC = MaximumCurvature(5, False) output_img = MC((input_img, input_fvr)) @@ -77,16 +78,16 @@ def test_miurarlt(): #Repeated Line Tracking method against Matlab reference - input_img_filename = F(('features', 'miurarlt_input_img.mat')) - input_fvr_filename = F(('features', 'miurarlt_input_fvr.mat')) - output_filename = F(('features', 'miurarlt_output.mat')) + input_img_filename = F(('extractors', 'miurarlt_input_img.mat')) + input_fvr_filename = F(('extractors', 'miurarlt_input_fvr.mat')) + output_filename = F(('extractors', 'miurarlt_output.mat')) # Load inputs input_img = bob.io.base.load(input_img_filename) input_fvr = bob.io.base.load(input_fvr_filename) # Apply Python implementation - from bob.fingervein.features.RepeatedLineTracking import RepeatedLineTracking + from bob.bio.vein.extractors.RepeatedLineTracking import RepeatedLineTracking RLT = RepeatedLineTracking(3000, 1, 21, False) output_img = RLT((input_img, input_fvr)) @@ -102,16 +103,16 @@ def test_huangwl(): #Wide Line Detector method against Matlab reference - input_img_filename = F(('features', 'huangwl_input_img.mat')) - input_fvr_filename = F(('features', 'huangwl_input_fvr.mat')) - output_filename = F(('features', 'huangwl_output.mat')) + input_img_filename = F(('extractors', 'huangwl_input_img.mat')) + input_fvr_filename = F(('extractors', 'huangwl_input_fvr.mat')) + output_filename = F(('extractors', 'huangwl_output.mat')) # Load inputs input_img = bob.io.base.load(input_img_filename) input_fvr = bob.io.base.load(input_fvr_filename) # Apply Python implementation - from bob.fingervein.features.WideLineDetector import WideLineDetector + from bob.bio.vein.extractors.WideLineDetector import WideLineDetector WL = WideLineDetector(5, 1, 41, False) output_img = WL((input_img, input_fvr)) @@ -123,17 +124,18 @@ def test_huangwl(): def test_miura_match(): - """Test matching: Match Ratio method against Matlab reference""" - template_filename = F(('matching', '0001_2_1_120509-135338.mat')) - probe_gen_filename = F(('matching', '0001_2_2_120509-135558.mat')) - probe_imp_filename = F(('matching', '0003_2_1_120509-141255.mat')) + #Match Ratio method against Matlab reference + + template_filename = F(('algorithms', '0001_2_1_120509-135338.mat')) + probe_gen_filename = F(('algorithms', '0001_2_2_120509-135558.mat')) + probe_imp_filename = F(('algorithms', '0003_2_1_120509-141255.mat')) template_vein = bob.io.base.load(template_filename) probe_gen_vein = bob.io.base.load(probe_gen_filename) probe_imp_vein = bob.io.base.load(probe_imp_filename) - from bob.fingervein.tools.MiuraMatch import MiuraMatch + from bob.bio.vein.algorithms.MiuraMatch import MiuraMatch MM = MiuraMatch(ch=18, cw=28) score_gen = MM.score(template_vein, probe_gen_vein) diff --git a/buildout.cfg b/buildout.cfg index fe03cdfbb5e1b90aa440637d86fa1e7c11c7cd4a..303cff70d1dd40d1f696142cafa2b228ebcd8bf0 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -10,12 +10,14 @@ eggs = bob.bio.vein bob.extension gridtk develop = src/bob.db.vera + src/bob.db.putvein . auto-checkout = * newest = false [sources] bob.db.vera = git git@github.com:bioidiap/bob.db.vera +bob.db.putvein = git git@gitlab.idiap.ch:biometric/bob.db.putvein [scripts] recipe = bob.buildout:scripts diff --git a/doc/references.rst b/doc/references.rst index 07af04f28260307e15b286ab7d5cc7aeaa7bc8f4..962d16145840fa924ccd5975300c9630e29a31b9 100644 --- a/doc/references.rst +++ b/doc/references.rst @@ -5,18 +5,18 @@ References ========== -.. [LLP09]_ *E.C. Lee, H.C. Lee and K.R. Park. Finger vein recognition using minutia-based alignment and local binary pattern-based feature extraction. International Journal of Imaging Systems and Technology. Vol. 19, No. 3, pp. 175-178, September 2009. +.. [KUU02]_ M. Kono, H. Ueki and S. Umemura. Near-infrared finger vein patterns for personal identification, Applied Optics, Vol. 41, Issue 35, pp. 7429-7436 (2002). -.. [KUU02]_ *M. Kono, H. Ueki and S. Umemura. Near-infrared finger vein patterns for personal identification, Applied Optics, Vol. 41, Issue 35, pp. 7429-7436 (2002). +.. [MNM04]_ N. Miura, A. Nagasaka, and T. Miyatake. Feature extraction of finger vein patterns based on repeated line tracking and its application to personal identification. Machine Vision and Applications, Vol. 15, Num. 4, pp. 194--203, 2004. -.. [ZY09]_ *J. Zhang and J. Yang. Finger-vein image enhancement based on combination of gray-level grouping and circular gabor filter. In International Conference on Information Engineering and Computer Science (ICIECS), pp. 1-4, Dec 2009. +.. [MNM05]_ N. Miura, A. Nagasaka, and T. Miyatake, Extraction of Finger-Vein Pattern Using Maximum Curvature Points in Image Profiles. Proceedings on IAPR conference on machine vision applications, Vol. 9 , pp. 347--350, 2005. -.. [ZTXL09]_ *Jianjun Zhao, Hogliang Tian, Weixing Xu, and Xin Li. A New Approach to Hand Vein Image Enhancement. In IEEE Second International Conference on Intelligent Computation Technology and Automation, ICICTA. Vol. 1, pp. 499-501. 2009. +.. [LLP09]_ E.C. Lee, H.C. Lee and K.R. Park. Finger vein recognition using minutia-based alignment and local binary pattern-based feature extraction. International Journal of Imaging Systems and Technology. Vol. 19, No. 3, pp. 175-178, September 2009. -.. [MNM05]_ *N. Miura, A. Nagasaka, and T. Miyatake, Extraction of Finger-Vein Pattern Using Maximum Curvature Points in Image Profiles. Proceedings on IAPR conference on machine vision applications, Vol. 9 , pp. 347--350, 2005. +.. [ZY09]_ J. Zhang and J. Yang. Finger-vein image enhancement based on combination of gray-level grouping and circular gabor filter. In International Conference on Information Engineering and Computer Science (ICIECS), pp. 1-4, Dec 2009. -.. [MNM04]_ *N. Miura, A. Nagasaka, and T. Miyatake. Feature extraction of finger vein patterns based on repeated line tracking and its application to personal identification. Machine Vision and Applications, Vol. 15, Num. 4, pp. 194--203, 2004. +.. [ZTXL09]_ Jianjun Zhao, Hogliang Tian, Weixing Xu, and Xin Li. A New Approach to Hand Vein Image Enhancement. In IEEE Second International Conference on Intelligent Computation Technology and Automation, ICICTA. Vol. 1, pp. 499-501. 2009. -.. [HDLTL10]_ *B. Huang, Y. Dai, R. Li, D. Tang and W. Li. Finger-vein authentication based on wide line detector and pattern normalization, Proceedings on 20th International Conference on Pattern Recognition (ICPR), 2010. +.. [HDLTL10]_ B. Huang, Y. Dai, R. Li, D. Tang and W. Li. Finger-vein authentication based on wide line detector and pattern normalization, Proceedings on 20th International Conference on Pattern Recognition (ICPR), 2010. -.. [MD13]_ *L. Mirmohamadsadeghi and A. Drygajlo. Palm vein recognition uisng local texture patterns, IET Biometrics, pp. 1-9, 2013. +.. [MD13]_ L. Mirmohamadsadeghi and A. Drygajlo. Palm vein recognition using local texture patterns, IET Biometrics, pp. 1-9, 2013. diff --git a/requirements.txt b/requirements.txt index c78467094456c0de2c4c214d6e6d6c19580473ec..35ecb8e09fc323229ccc0fedc5d72430c83a5d63 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,8 +6,10 @@ argparse bob.extension bob.core bob.io.base -bob.ip.base bob.io.matlab +bob.io.image +bob.ip.base bob.bio.base bob.db.utfvp bob.db.vera +bob.db.putvein