Skip to content
Snippets Groups Projects
Commit a8586e10 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Fix loading of fv3d fingers

parent b6acc543
No related branches found
No related tags found
1 merge request!353DFV and multiple fixes
...@@ -8,6 +8,7 @@ import numpy ...@@ -8,6 +8,7 @@ import numpy
from bob.bio.base.database import BioFile, BioDatabase from bob.bio.base.database import BioFile, BioDatabase
from . import AnnotatedArray from . import AnnotatedArray
from ..preprocessor.utils import poly_to_mask
class File(BioFile): class File(BioFile):
...@@ -38,13 +39,15 @@ class File(BioFile): ...@@ -38,13 +39,15 @@ class File(BioFile):
"""(Overrides base method) Loads both image and mask""" """(Overrides base method) Loads both image and mask"""
image = super(File, self).load(*args, **kwargs) image = super(File, self).load(*args, **kwargs)
image = numpy.rot90(image, 3)
roi = self.__f.roi() roi = self.__f.roi()
# calculates the 90 degrees anti-clockwise rotated RoI points # calculates the 90 degrees anti-clockwise rotated RoI points
h, w = image.shape w, h = image.shape
roi = [(x,-y+h) for k in roi] 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): class Database(BioDatabase):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment