Commit 488da460 by André Anjos

Integrated 'watershed_mask.py' on documentation

parent c6a262e6
Pipeline #14684 failed with stages
in 4 minutes 48 seconds
......@@ -28,11 +28,11 @@ Options:
-f, --fg-threshold=<float> Foreground threshold value. Should be set to a
number that is between 0.5 and 1.0. The higher,
the less markers for the foreground watershed
process will be produced. [default: 0.7]
process will be produced. [default: 0.6]
-b, --bg-threshold=<float> Background threshold value. Should be set to a
number that is between 0.0 and 0.5. The smaller,
the less markers for the foreground watershed
process will be produced. [default: 0.3]
process will be produced. [default: 0.2]
-m, --model=<path> Path to model to use to find watershed markers.
If not set, use the database's associated default
-S, --scan If set, ignores settings for the threshold and
......@@ -272,13 +272,16 @@ def main(user_input=None):
sys.exit(e)
if args['<database>'] == 'fv3d':
from ..configurations.fv3d import database as db, _model as model
from ..configurations.fv3d import database as db
elif args['<database>'] == 'verafinger':
from ..configurations.verafinger import database as db, _model as model
from ..configurations.verafinger import database as db
elif args['<database>'] == 'hkpu':
from ..configurations.hkpu import database as db, _model as model
from ..configurations.hkpu import database as db
elif args['<database>'] == 'thufvdt':
from ..configurations.thufvdt import database as db, _model as model
from ..configurations.thufvdt import database as db
# resolves the default watershed model to use
model = pkg_resources.resource_filename(__name__, os.path.join('..', 'configurations', 'data', args['<database>'] + '.hdf5'))
# get the right default model for the relevant dataset if none is passed
args['--model'] = args['--model'] or model
......
......@@ -157,4 +157,41 @@ constructing an object and attaching it to the
:py:class:`bob.bio.vein.preprocessor.Preprocessor` entry on your configuration.
.. note::
By default, we provide pre-trained neural networks with specific
configurations for each dataset. If not explicitly set when instantiating
the preprocessor, these defaults are used. You can find these models under
this package's data (see the ``data`` directory under
``bob.bio.vein.configurations``).
Visualizing the Watershed Finger region detector
------------------------------------------------
The utility ``watershed_mask.py`` can help you visualize the output of the
Watersheding preprocessing. By default, it displays the result of preprocessing
one sample from a database:
.. code-block:: sh
$ watershed_mask.py verafinger 001-M/001_L_1
Should produce an image like the following:
.. figure:: img/watershed.*
:scale: 50%
Example RoI overlayed on finger vein image of the Vera fingervein database,
as produced by the script ``watershed_mask.py``.
The application ``watershed_mask.py`` has more options allowing you to override
the model used for marker detection, thresholds, save resulting images from the
various processing phases or scan for thresholds. Use ``--help`` for help.
.. include:: links.rst
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