Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
bob.bio.vein
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bob
bob.bio.vein
Commits
6026bd8b
Commit
6026bd8b
authored
Jul 07, 2017
by
André Anjos
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reflected changes from copper->crop renaming
parent
2274b531
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
117 deletions
+11
-117
bob/bio/vein/configurations/maximum_curvature.py
bob/bio/vein/configurations/maximum_curvature.py
+2
-2
bob/bio/vein/configurations/repeated_line_tracking.py
bob/bio/vein/configurations/repeated_line_tracking.py
+2
-2
bob/bio/vein/configurations/wide_line_detector.py
bob/bio/vein/configurations/wide_line_detector.py
+2
-2
bob/bio/vein/preprocessor/__init__.py
bob/bio/vein/preprocessor/__init__.py
+5
-4
bob/bio/vein/preprocessor/cropper.py
bob/bio/vein/preprocessor/cropper.py
+0
-107
No files found.
bob/bio/vein/configurations/maximum_curvature.py
View file @
6026bd8b
...
...
@@ -20,7 +20,7 @@ or the attribute ``sub_directory`` in a configuration file loaded **after**
this resource.
"""
from
..preprocessor
import
NoCrop
per
,
Padder
,
TomesLeeMask
,
\
from
..preprocessor
import
NoCrop
,
Padder
,
TomesLeeMask
,
\
HuangNormalization
,
NoFilter
,
Preprocessor
# Filter sizes for the vertical "high-pass" filter
...
...
@@ -32,7 +32,7 @@ PAD_WIDTH = 5
PAD_CONST
=
51
preprocessor
=
Preprocessor
(
crop
=
NoCrop
per
(),
crop
=
NoCrop
(),
mask
=
TomesLeeMask
(
filter_height
=
FILTER_HEIGHT
,
filter_width
=
FILTER_WIDTH
),
normalize
=
HuangNormalization
(
padding_width
=
PAD_WIDTH
,
padding_constant
=
PAD_CONST
),
...
...
bob/bio/vein/configurations/repeated_line_tracking.py
View file @
6026bd8b
...
...
@@ -20,7 +20,7 @@ or the attribute ``sub_directory`` in a configuration file loaded **after**
this resource.
"""
from
..preprocessor
import
NoCrop
per
,
Padder
,
TomesLeeMask
,
\
from
..preprocessor
import
NoCrop
,
Padder
,
TomesLeeMask
,
\
HuangNormalization
,
NoFilter
,
Preprocessor
# Filter sizes for the vertical "high-pass" filter
...
...
@@ -32,7 +32,7 @@ PAD_WIDTH = 5
PAD_CONST
=
51
preprocessor
=
Preprocessor
(
crop
=
NoCrop
per
(),
crop
=
NoCrop
(),
mask
=
TomesLeeMask
(
filter_height
=
FILTER_HEIGHT
,
filter_width
=
FILTER_WIDTH
),
normalize
=
HuangNormalization
(
padding_width
=
PAD_WIDTH
,
padding_constant
=
PAD_CONST
),
...
...
bob/bio/vein/configurations/wide_line_detector.py
View file @
6026bd8b
...
...
@@ -20,7 +20,7 @@ or the attribute ``sub_directory`` in a configuration file loaded **after**
this resource.
"""
from
..preprocessor
import
NoCrop
per
,
Padder
,
TomesLeeMask
,
\
from
..preprocessor
import
NoCrop
,
Padder
,
TomesLeeMask
,
\
HuangNormalization
,
NoFilter
,
Preprocessor
# Filter sizes for the vertical "high-pass" filter
...
...
@@ -32,7 +32,7 @@ PAD_WIDTH = 5
PAD_CONST
=
51
preprocessor
=
Preprocessor
(
crop
=
NoCrop
per
(),
crop
=
NoCrop
(),
mask
=
TomesLeeMask
(
filter_height
=
FILTER_HEIGHT
,
filter_width
=
FILTER_WIDTH
),
normalize
=
HuangNormalization
(
padding_width
=
PAD_WIDTH
,
padding_constant
=
PAD_CONST
),
...
...
bob/bio/vein/preprocessor/__init__.py
View file @
6026bd8b
from
.crop
per
import
Cropper
,
FixedCropper
,
NoCropper
from
.mask
import
Padder
,
Masker
,
FixedMask
,
AnnotatedRoIMask
from
.crop
import
Cropper
,
FixedCrop
,
NoCrop
from
.mask
import
Padder
,
Masker
,
FixedMask
,
NoMask
,
AnnotatedRoIMask
from
.mask
import
KonoMask
,
LeeMask
,
TomesLeeMask
from
.normalize
import
Normalizer
,
NoNormalization
,
HuangNormalization
from
.filters
import
Filter
,
NoFilter
,
HistogramEqualization
...
...
@@ -21,11 +21,12 @@ def __appropriate__(*args):
__appropriate__
(
Cropper
,
FixedCrop
per
,
NoCrop
per
,
FixedCrop
,
NoCrop
,
Padder
,
Masker
,
FixedMask
,
NoMask
,
AnnotatedRoIMask
,
KonoMask
,
LeeMask
,
...
...
bob/bio/vein/preprocessor/cropper.py
deleted
100644 → 0
View file @
2274b531
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
'''Base utilities for pre-cropping images'''
import
numpy
class
Cropper
(
object
):
"""This is the base class for all croppers
It defines the minimum requirements for all derived cropper classes.
"""
def
__init__
(
self
):
pass
def
__call__
(
self
,
image
):
"""Overwrite this method to implement your masking method
Parameters:
image (numpy.ndarray): A 2D numpy array of type ``uint8`` with the
input image
Returns:
numpy.ndarray: A 2D numpy array of the same type as the input, with
cropped rows and columns as per request
"""
raise
NotImplemented
(
'You must implement the __call__ slot'
)
class
FixedCropper
(
object
):
"""Implements cropping using a fixed suppression of border pixels
The defaults supress no lines from the image and returns an image like the
original.
.. note::
Before choosing values, note you're responsible for knowing what is the
orientation of images fed into this cropper.
Parameters:
top (:py:class:`int`, optional): Number of lines to suppress from the top
of the image. The top of the image corresponds to ``y = 0``.
bottom (:py:class:`int`, optional): Number of lines to suppress from the
bottom of the image. The bottom of the image corresponds to ``y =
height``.
left (:py:class:`int`, optional): Number of lines to suppress from the left
of the image. The left of the image corresponds to ``x = 0``.
right (:py:class:`int`, optional): Number of lines to suppress from the
right of the image. The right of the image corresponds to ``x = width``.
"""
def
__init__
(
self
,
top
=
0
,
bottom
=
0
,
left
=
0
,
right
=
0
):
self
.
top
=
top
self
.
bottom
=
bottom
self
.
left
=
left
self
.
right
=
right
def
__call__
(
self
,
image
):
"""Returns a big mask
Parameters:
image (numpy.ndarray): A 2D numpy array of type ``uint8`` with the
input image
Returns:
numpy.ndarray: A 2D numpy array of type boolean with the caculated
mask. ``True`` values correspond to regions where the finger is
situated
"""
# this should work even if limits are zeros
h
,
w
=
image
.
shape
return
image
[
self
.
top
:
h
-
self
.
bottom
,
self
.
left
:
w
-
self
.
right
]
class
NoCropper
(
FixedCropper
):
"""Convenience: same as FixedCropper()"""
def
__init__
(
self
):
super
(
NoCropper
,
self
).
__init__
(
0
,
0
,
0
,
0
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment