Commit 9ffcdd0a authored by Gilberto Astolfi's avatar Gilberto Astolfi
Browse files

Merge branch 'correcao-exclusao-imagens'

parents 3b4df001 2789b389
......@@ -550,7 +550,8 @@ class Act(object):
for idx_segment in list_segments:
segment, size_segment, idx_segment = self.segmenter.get_segment(self, idx_segment=idx_segment)[:-1]
filepath = File.save_class_image(segment, self.dataset, tmp, self._image_name, idx_segment)
# Problem here! Dataset removed.
filepath = File.save_only_class_image(segment, self.dataset, tmp, self._image_name, idx_segment)
len_segments[idx_segment] = size_segment
# Perform the feature extraction of all segments in image ( not applied to ConvNets ).
......
......@@ -25,7 +25,7 @@ class SkimageSegmenter(object):
__metaclass__ = ABCMeta
# flag FORCE_OPT highly increases speed of method paint_segment_skimage but performs a flawed painting
FORCE_OPT = False
FORCE_OPT = True
def __init__(self, border_color = 'Yellow', border_outline = 'No'):
"""Constructor.
......
......@@ -177,6 +177,33 @@ class File(object):
return File.save_image(image, File.make_path(dataset, directory), filename + '_%05d' % idx, ext)
@staticmethod
def save_only_class_image(image, dataset, directory, filename, idx, ext = '.tif'):
"""Save a class image only.
Parameters
----------
image : opencv image
Image to be saved.
dataset : string
Path do image dataset.
directory : string
Directory where image must be saved.
image : string
Name of image.
image : string
Name of image.
idx : integer
Index of image inside the class.
ext : string, optional, default = '.tif'
Extension which image must be saved in format .ext.
Returns
-------
filepath : string
Return the complete filepath where image was saved.
"""
return File.save_image(image, File.make_path(dataset, directory), filename + '_%05d' % idx, ext)
@staticmethod
def list_dirs(dataset):
"""List all directories inside the dataset.
......
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