Beispiel #1
0
 def generateSegments(self):
     if self.GEN_SEGMENTS:
         img = self.loadImageCol()
         marker = SeamMarker(img=np.zeros((2, 2), dtype=np.uint8))
         coords = prepPointCoord(self.coords_down_path)
         segments = marker.segmentImageWithPointListSeamCoordinate(
             image=img, coords=coords)
         paths = self.segmentPaths
         [[
             Image.fromarray(segs[i]).save(paths[i])
             for i in range(len(segs))
         ] for direction, segs in segments.items()]
Beispiel #2
0
 def test_seammarker_segmentImageWithPointListSeamCoordinate(self):
     img = self.loadImageCol()
     marker = SeamMarker(img=np.zeros((2, 2), dtype=np.uint8))
     coords = prepPointCoord(self.coords_down_path)
     segments = marker.segmentImageWithPointListSeamCoordinate(
         image=img, coords=coords)
     compsegs = self.loadSegments()
     message = "Segment {0} failed"
     # pdb.set_trace()
     compvals = [[
         self.compareArrays(segs[i], compsegs[i], message.format(str(i)))
         for i in range(len(segs))
     ] for direction, segs in segments.items()]