From 0a6b3b747ba7a33e10b29d1fcd80f3c4b7ae10b4 Mon Sep 17 00:00:00 2001 From: Andre Anjos <andre.anjos@idiap.ch> Date: Thu, 6 Jul 2017 16:30:56 +0200 Subject: [PATCH] If sample does not have roi, then returns only image --- bob/bio/vein/database/fv3d.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bob/bio/vein/database/fv3d.py b/bob/bio/vein/database/fv3d.py index e984505..b84f117 100644 --- a/bob/bio/vein/database/fv3d.py +++ b/bob/bio/vein/database/fv3d.py @@ -40,12 +40,17 @@ class File(BioFile): image = super(File, self).load(*args, **kwargs) image = numpy.rot90(image, 3) - roi = self.__f.roi() - # calculates the 90 degrees anti-clockwise rotated RoI points - w, h = image.shape - roi = [(x,h-y) for (y,x) in roi] - mask = poly_to_mask(image.shape, roi) + if not self.has_roi(): + return image + + else: + roi = self.__f.roi() + + # calculates the 90 degrees anti-clockwise rotated RoI points + w, h = image.shape + roi = [(x,h-y) for (y,x) in roi] + mask = poly_to_mask(image.shape, roi) return AnnotatedArray(image, metadata=dict(mask=mask, roi=roi)) -- GitLab