From a8586e10e866f81faf36d742e2b1f3eac5c4f79c Mon Sep 17 00:00:00 2001 From: Andre Anjos Date: Mon, 3 Jul 2017 12:40:30 +0200 Subject: [PATCH] Fix loading of fv3d fingers --- bob/bio/vein/database/fv3d.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bob/bio/vein/database/fv3d.py b/bob/bio/vein/database/fv3d.py index 8d8251d..e984505 100644 --- a/bob/bio/vein/database/fv3d.py +++ b/bob/bio/vein/database/fv3d.py @@ -8,6 +8,7 @@ import numpy from bob.bio.base.database import BioFile, BioDatabase from . import AnnotatedArray +from ..preprocessor.utils import poly_to_mask class File(BioFile): @@ -38,13 +39,15 @@ class File(BioFile): """(Overrides base method) Loads both image and mask""" 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 - h, w = image.shape - roi = [(x,-y+h) for k in roi] + w, h = image.shape + roi = [(x,h-y) for (y,x) in roi] + mask = poly_to_mask(image.shape, roi) - return ImageWithAnnotation(numpy.rot90(image), metadata=dict(mask=roi)) + return AnnotatedArray(image, metadata=dict(mask=mask, roi=roi)) class Database(BioDatabase): -- 2.21.0