Commit c2e01b6c authored by Diego André Sant'Ana's avatar Diego André Sant'Ana 🤞
Browse files

alter

parent 90e7e67f
......@@ -566,7 +566,7 @@ class Act(object):
print("Wait to complete processes all images!")
with tqdm(total=len(list_segments)) as pppbar:
for idx_segment in list_segments:
segment, size_segment, idx_segment = self.segmenter.get_segment(self, idx_segment=idx_segment)[:-1]
segment, size_segment,xml, idx_segment = self.segmenter.get_segment(self, idx_segment=idx_segment)[:-1]
# 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
......
......@@ -117,8 +117,9 @@ class SkimageSegmenter(object):
# Get the rectangle that encompasses the countour
x,y,w,h = cv2.boundingRect(max_contour)
# Create the object for this segment in the .XML file
xml_file.addObject(name_segment, x, y, x+w, y+h)
# Create the object for this segment in the .XML file
if(xml_file!=None):
xml_file.addObject(name_segment, x, y, x+w, y+h)
segment = segment[y:y+h, x:x+w]
end_time = TimeUtils.get_time()
......
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