Commit ccd5a085 authored by André Anjos's avatar André Anjos 💬

Merge branch 'fixing-warnings' into 'master'

Fixed the wornings of the sphinx documentation

The warnings coming from sphinx documentation are now fixed. Please merge this branch into master. Thank you!

See merge request !11
parents 17ecc712 3bded613
Pipeline #4673 passed with stages
in 19 minutes and 2 seconds
...@@ -20,14 +20,15 @@ class MiuraMatch (Algorithm): ...@@ -20,14 +20,15 @@ class MiuraMatch (Algorithm):
194--203, 2004 194--203, 2004
Parameters: **Parameters:**
ch (int, Optional): Maximum search displacement in y-direction. Different ch : :py:class:`int`
Optional : Maximum search displacement in y-direction. Different
defult values based on the different features. defult values based on the different features.
cw (int, Optional): Maximum search displacement in x-direction. Different cw : :py:class:`int`
Optional : Maximum search displacement in x-direction. Different
defult values based on the different features. defult values based on the different features.
""" """
def __init__(self, def __init__(self,
...@@ -80,8 +81,13 @@ class MiuraMatch (Algorithm): ...@@ -80,8 +81,13 @@ class MiuraMatch (Algorithm):
def score(self, model, probe): def score(self, model, probe):
"""Computes the score of the probe and the model """
Return score - Value between 0 and 0.5, larger value is better match Computes the score of the probe and the model.
**Parameters:**
score : :py:class:`float`
Value between 0 and 0.5, larger value is better match
""" """
#print model.shape #print model.shape
#print probe.shape #print probe.shape
......
...@@ -13,16 +13,17 @@ from .. import utils ...@@ -13,16 +13,17 @@ from .. import utils
class MaximumCurvature (Extractor): class MaximumCurvature (Extractor):
"""MiuraMax feature extractor """
MiuraMax feature extractor.
Based on N. Miura, A. Nagasaka, and T. Miyatake, Extraction of Finger-Vein Based on N. Miura, A. Nagasaka, and T. Miyatake, Extraction of Finger-Vein
Pattern Using Maximum Curvature Points in Image Profiles. Proceedings on IAPR Pattern Using Maximum Curvature Points in Image Profiles. Proceedings on IAPR
conference on machine vision applications, 9 (2005), pp. 347--350 conference on machine vision applications, 9 (2005), pp. 347--350
Parameters: **Parameters:**
sigma (int, Optional): Sigma used for determining derivatives
sigma : :py:class:`int`
Optional: Sigma used for determining derivatives.
""" """
......
...@@ -17,7 +17,8 @@ from .. import utils ...@@ -17,7 +17,8 @@ from .. import utils
class FingerCrop (Preprocessor): class FingerCrop (Preprocessor):
"""Extracts the mask and pre-processes fingervein images """
Extracts the mask and pre-processes fingervein images.
Based on the implementation: E.C. Lee, H.C. Lee and K.R. Park. Finger vein Based on the implementation: E.C. Lee, H.C. Lee and K.R. Park. Finger vein
recognition using minutia-based alignment and local binary pattern-based recognition using minutia-based alignment and local binary pattern-based
...@@ -32,37 +33,42 @@ class FingerCrop (Preprocessor): ...@@ -32,37 +33,42 @@ class FingerCrop (Preprocessor):
4. (optionally) Post processed 4. (optionally) Post processed
Parameters: **Parameters:**
mask_h (int, Optional): Height of contour mask in pixels, must be an even mask_h : :py:class:`int`
Optional, Height of contour mask in pixels, must be an even
number number
mask_w (int, Optional): Width of the contour mask in pixels mask_w : :py:class:`int`
Optional, Width of the contour mask in pixels
padding_width (int, Optional): How much padding (in pixels) to add around padding_width : :py:class:`int`
Optional, How much padding (in pixels) to add around
the borders of the input image. We normally always keep this value on its the borders of the input image. We normally always keep this value on its
default (5 pixels). default (5 pixels).
padding_constant (int, Optional): What is the value of the pixels added padding_constant : :py:class:`int`
Optional, What is the value of the pixels added
to the padding. This number should be a value between 0 and 255. (From to the padding. This number should be a value between 0 and 255. (From
Pedro Tome: for UTFVP (high-quality samples), use 0. For the VERA Pedro Tome: for UTFVP (high-quality samples), use 0. For the VERA
Fingervein database (low-quality samples), use 51 (that corresponds to Fingervein database (low-quality samples), use 51 (that corresponds to
0.2 in a float image with values between 0 and 1). 0.2 in a float image with values between 0 and 1).
fingercontour (str, Optional): Select between three finger contour fingercontour : :py:class:`str`
Optional, Select between three finger contour
implementations: ``"leemaskMod"``, ``"leemaskMatlab"`` or ``"konomask"``. implementations: ``"leemaskMod"``, ``"leemaskMatlab"`` or ``"konomask"``.
(From Pedro Tome: the option ``leemaskMatlab`` was just implemented for (From Pedro Tome: the option ``leemaskMatlab`` was just implemented for
testing purposes so we could compare with MAT files generated from Matlab testing purposes so we could compare with MAT files generated from Matlab
code of other authors. He only used it with the UTFVP database, using code of other authors. He only used it with the UTFVP database, using
``leemaskMod`` with that database yields slight worse results.) ``leemaskMod`` with that database yields slight worse results.)
postprocessing (str, Optional): Select between ``HE`` (histogram postprocessing : :py:class:`str`
Optional, Select between ``HE`` (histogram
equalization, as with :py:func:`bob.ip.base.histogram_equalization`), equalization, as with :py:func:`bob.ip.base.histogram_equalization`),
``HFE`` (high-frequency emphasis filter, with hard-coded parameters - see ``HFE`` (high-frequency emphasis filter, with hard-coded parameters - see
implementation) or ``CircGabor`` (circular Gabor filter with band-width implementation) or ``CircGabor`` (circular Gabor filter with band-width
1.12 octaves and standard deviation of 5 pixels (this is hard-coded)). By 1.12 octaves and standard deviation of 5 pixels (this is hard-coded)). By
default, no postprocessing is applied on the image. default, no postprocessing is applied on the image.
""" """
...@@ -91,7 +97,8 @@ class FingerCrop (Preprocessor): ...@@ -91,7 +97,8 @@ class FingerCrop (Preprocessor):
def __konomask__(self, image, sigma): def __konomask__(self, image, sigma):
"""Finger vein mask extractor """
Finger vein mask extractor.
Based on the work of M. Kono, H. Ueki and S. Umemura. Near-infrared finger Based on the work of M. Kono, H. Ueki and S. Umemura. Near-infrared finger
vein patterns for personal identification, Applied Optics, Vol. 41, Issue vein patterns for personal identification, Applied Optics, Vol. 41, Issue
...@@ -144,7 +151,8 @@ class FingerCrop (Preprocessor): ...@@ -144,7 +151,8 @@ class FingerCrop (Preprocessor):
def __leemaskMod__(self, image): def __leemaskMod__(self, image):
"""A method to calculate the finger mask """
A method to calculate the finger mask.
Based on the work of Finger vein recognition using minutia-based alignment Based on the work of Finger vein recognition using minutia-based alignment
and local binary pattern-based feature extraction, E.C. Lee, H.C. Lee and and local binary pattern-based feature extraction, E.C. Lee, H.C. Lee and
...@@ -160,19 +168,19 @@ class FingerCrop (Preprocessor): ...@@ -160,19 +168,19 @@ class FingerCrop (Preprocessor):
a horizontal filter is also applied on the vertical axis. a horizontal filter is also applied on the vertical axis.
Parameters: **Parameters:**
image (numpy.ndarray): raw image to use for finding the mask, as 2D array image (numpy.ndarray): raw image to use for finding the mask, as 2D array
of unsigned 8-bit integers of unsigned 8-bit integers
Returns: **Returns:**
numpy.ndarray: A 2D boolean array with the same shape of the input image numpy.ndarray: A 2D boolean array with the same shape of the input image
representing the cropping mask. ``True`` values indicate where the representing the cropping mask. ``True`` values indicate where the
finger is. finger is.
numpy.ndarray: A 2D array with 64-bit floats indicating the indexes where numpy.ndarray: A 2D array with 64-bit floats indicating the indexes where
the mask, for each column, starts and ends on the original image. The the mask, for each column, starts and ends on the original image. The
same of this array is (2, number of columns on input image). same of this array is (2, number of columns on input image).
...@@ -234,7 +242,8 @@ class FingerCrop (Preprocessor): ...@@ -234,7 +242,8 @@ class FingerCrop (Preprocessor):
def __leemaskMatlab__(self, image): def __leemaskMatlab__(self, image):
"""A method to calculate the finger mask """
A method to calculate the finger mask.
Based on the work of Finger vein recognition using minutia-based alignment Based on the work of Finger vein recognition using minutia-based alignment
and local binary pattern-based feature extraction, E.C. Lee, H.C. Lee and and local binary pattern-based feature extraction, E.C. Lee, H.C. Lee and
...@@ -255,19 +264,19 @@ class FingerCrop (Preprocessor): ...@@ -255,19 +264,19 @@ class FingerCrop (Preprocessor):
and goes up to the point where the minima is detected on the lower part. and goes up to the point where the minima is detected on the lower part.
Parameters: **Parameters:**
image (numpy.ndarray): raw image to use for finding the mask, as 2D array image (numpy.ndarray): raw image to use for finding the mask, as 2D array
of unsigned 8-bit integers of unsigned 8-bit integers
Returns: **Returns:**
numpy.ndarray: A 2D boolean array with the same shape of the input image numpy.ndarray: A 2D boolean array with the same shape of the input image
representing the cropping mask. ``True`` values indicate where the representing the cropping mask. ``True`` values indicate where the
finger is. finger is.
numpy.ndarray: A 2D array with 64-bit floats indicating the indexes where numpy.ndarray: A 2D array with 64-bit floats indicating the indexes where
the mask, for each column, starts and ends on the original image. The the mask, for each column, starts and ends on the original image. The
same of this array is (2, number of columns on input image). same of this array is (2, number of columns on input image).
...@@ -308,7 +317,8 @@ class FingerCrop (Preprocessor): ...@@ -308,7 +317,8 @@ class FingerCrop (Preprocessor):
def __huangnormalization__(self, image, mask, edges): def __huangnormalization__(self, image, mask, edges):
"""Simple finger normalization """
Simple finger normalization.
Based on B. Huang, Y. Dai, R. Li, D. Tang and W. Li, Finger-vein Based on B. Huang, Y. Dai, R. Li, D. Tang and W. Li, Finger-vein
authentication based on wide line detector and pattern normalization, authentication based on wide line detector and pattern normalization,
...@@ -325,27 +335,25 @@ class FingerCrop (Preprocessor): ...@@ -325,27 +335,25 @@ class FingerCrop (Preprocessor):
through those points. through those points.
Parameters: **Parameters:**
image (numpy.ndarray): raw image to normalize as 2D array of unsigned image (numpy.ndarray): raw image to normalize as 2D array of unsigned
8-bit integers 8-bit integers
mask (numpy.ndarray): mask to normalize as 2D array of booleans mask (numpy.ndarray): mask to normalize as 2D array of booleans
edges (numpy.ndarray): edges of the mask, 2D array with 2 rows and as edges (numpy.ndarray): edges of the mask, 2D array with 2 rows and as
many columns as the input image, containing the start of the mask and many columns as the input image, containing the start of the mask and
the end of the mask. the end of the mask.
Returns: **Returns:**
numpy.ndarray: A 2D boolean array with the same shape and data type of numpy.ndarray: A 2D boolean array with the same shape and data type of
the input image representing the newly aligned image. the input image representing the newly aligned image.
numpy.ndarray: A 2D boolean array with the same shape and data type of numpy.ndarray: A 2D boolean array with the same shape and data type of
the input mask representing the newly aligned mask. the input mask representing the newly aligned mask.
""" """
img_h, img_w = image.shape img_h, img_w = image.shape
...@@ -402,7 +410,8 @@ class FingerCrop (Preprocessor): ...@@ -402,7 +410,8 @@ class FingerCrop (Preprocessor):
def __HE__(self, image, mask): def __HE__(self, image, mask):
"""Applies histogram equalization on the input image inside the mask """
Applies histogram equalization on the input image inside the mask.
In this implementation, only the pixels that lie inside the mask will be In this implementation, only the pixels that lie inside the mask will be
used to calculate the histogram equalization parameters. Because of this used to calculate the histogram equalization parameters. Because of this
...@@ -410,20 +419,19 @@ class FingerCrop (Preprocessor): ...@@ -410,20 +419,19 @@ class FingerCrop (Preprocessor):
and have one based exclusively on NumPy. and have one based exclusively on NumPy.
Parameters: **Parameters:**
image (numpy.ndarray): raw image to be filtered, as 2D array of image (numpy.ndarray): raw image to be filtered, as 2D array of
unsigned 8-bit integers unsigned 8-bit integers
mask (numpy.ndarray): mask of the same size of the image, but composed mask (numpy.ndarray): mask of the same size of the image, but composed
of boolean values indicating which values should be considered for of boolean values indicating which values should be considered for
the histogram equalization the histogram equalization
Returns: **Returns:**
numpy.ndarray: normalized image as a 2D array of unsigned 8-bit numpy.ndarray: normalized image as a 2D array of unsigned 8-bit integers
integers
""" """
...@@ -444,24 +452,23 @@ class FingerCrop (Preprocessor): ...@@ -444,24 +452,23 @@ class FingerCrop (Preprocessor):
def __circularGabor__(self, image, bw, sigma): def __circularGabor__(self, image, bw, sigma):
"""Applies a circular gabor filter on the input image, with parameters """
Applies a circular gabor filter on the input image, with parameters.
Parameters: **Parameters:**
image (numpy.ndarray): raw image to be filtered, as 2D array of image (numpy.ndarray): raw image to be filtered, as 2D array of
unsigned 8-bit integers unsigned 8-bit integers
bw (float): bandwidth (1.12 octave) bw (float): bandwidth (1.12 octave)
sigma (int): standard deviation (5 pixels)
sigma (int): standard deviation (5 pixels)
Returns:
numpy.ndarray: normalized image as a 2D array of unsigned 8-bit **Returns:**
integers
numpy.ndarray: normalized image as a 2D array of unsigned 8-bit integers
""" """
# Converts image to doubles # Converts image to doubles
...@@ -496,8 +503,8 @@ class FingerCrop (Preprocessor): ...@@ -496,8 +503,8 @@ class FingerCrop (Preprocessor):
def __HFE__(self,image): def __HFE__(self,image):
""" High Frequency Emphasis Filtering (HFE) """
High Frequency Emphasis Filtering (HFE).
""" """
### Hard-coded parameters for the HFE filtering ### Hard-coded parameters for the HFE filtering
...@@ -537,7 +544,8 @@ class FingerCrop (Preprocessor): ...@@ -537,7 +544,8 @@ class FingerCrop (Preprocessor):
def __call__(self, image, annotations=None): def __call__(self, image, annotations=None):
"""Reads the input image, extract the mask of the fingervein, postprocesses """
Reads the input image, extract the mask of the fingervein, postprocesses.
""" """
# 1. Pads the input image if any padding should be added # 1. Pads the input image if any padding should be added
......
...@@ -30,9 +30,29 @@ extensions = [ ...@@ -30,9 +30,29 @@ extensions = [
import sphinx import sphinx
if sphinx.__version__ >= "1.4.1": if sphinx.__version__ >= "1.4.1":
extensions.append('sphinx.ext.imgmath') extensions.append('sphinx.ext.imgmath')
imgmath_image_format = 'svg'
else: else:
extensions.append('sphinx.ext.pngmath') extensions.append('sphinx.ext.pngmath')
# Be picky about warnings
nitpicky = True
# Ignores stuff we can't easily resolve on other project's sphinx manuals
nitpick_ignore = []
# Allows the user to override warnings from a separate file
if os.path.exists('nitpick-exceptions.txt'):
for line in open('nitpick-exceptions.txt'):
if line.strip() == "" or line.startswith("#"):
continue
dtype, target = line.split(None, 1)
target = target.strip()
try: # python 2.x
target = unicode(target)
except NameError:
pass
nitpick_ignore.append((dtype, target))
# Always includes todos # Always includes todos
todo_include_todos = True todo_include_todos = True
...@@ -111,7 +131,7 @@ pygments_style = 'sphinx' ...@@ -111,7 +131,7 @@ pygments_style = 'sphinx'
# Some variables which are useful for generated material # Some variables which are useful for generated material
project_variable = project.replace('.', '_') project_variable = project.replace('.', '_')
short_description = u'Vein Recognition Library' short_description = u'bob.biovein API'
owner = [u'Idiap Research Institute'] owner = [u'Idiap Research Institute']
...@@ -216,8 +236,13 @@ autodoc_default_flags = [ ...@@ -216,8 +236,13 @@ autodoc_default_flags = [
] ]
# For inter-documentation mapping: # For inter-documentation mapping:
from bob.extension.utils import link_documentation from bob.extension.utils import link_documentation, load_requirements
intersphinx_mapping = link_documentation() sphinx_requirements = "extra-intersphinx.txt"
if os.path.exists(sphinx_requirements):
intersphinx_mapping = link_documentation(additional_packages=load_requirements(sphinx_requirements))
else:
intersphinx_mapping = link_documentation()
# We want to remove all private (i.e. _. or __.__) members # We want to remove all private (i.e. _. or __.__) members
# that are not in the list of accepted functions # that are not in the list of accepted functions
......
py:class bob.bio.base.database.BioFile
py:class bob.bio.base.database.BioDatabase
py:class BioFile
py:class bob.bio.base.database.database.BioDatabase
py:class BioFileSet
py:class bob.bio.base.database.file.BioFile
py:class bob.bio.base.preprocessor.Preprocessor.Preprocessor
py:class bob.bio.base.extractor.Extractor.Extractor
py:class bob.bio.base.algorithm.Algorithm.Algorithm
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