Ejemplo n.º 1
0
 def generateRowMarkedImage(self):
     if self.GEN_ROW_MARKED:
         isUpTo = True
         colSlice = False
         demot = self.loadImageRow()
         points = loadJfile(self.points_left_path)
         point = points["2"]
         point_coord = (point['y'], point['x'])
         marker = SeamMarker(demot)
         markedImage = marker.markSeam4Point(demot,
                                             point_coord,
                                             isUpTo,
                                             point['threshold'],
                                             colSlice,
                                             mark_color=[0, 255, 0])
         Image.fromarray(markedImage).save(self.rowMarkedImagePath)
Ejemplo n.º 2
0
 def generateColMarkedImage(self):
     if self.GEN_COL_MARKED:
         isUpTo = False
         colSlice = True
         viet = self.loadImageCol()
         points = loadJfile(self.points_down_path)
         point = points["0"]
         point_coord = (point['y'], point['x'])
         marker = SeamMarker(viet)
         markedImage = marker.markSeam4Point(viet,
                                             point_coord,
                                             isUpTo,
                                             point['threshold'],
                                             colSlice,
                                             mark_color=[0, 255, 0])
         Image.fromarray(markedImage).save(self.colMarkedImagePath)
Ejemplo n.º 3
0
 def test_seammarker_markSeam4Point_colSliceTrue_isUpToFalse(self):
     isUpTo = False
     colSlice = True
     viet = self.loadImageCol()
     points = loadJfile(self.points_down_path)
     point = points["0"]
     point_coord = (point['y'], point['x'])
     marker = SeamMarker(viet)
     markedImage = marker.markSeam4Point(viet,
                                         point_coord,
                                         isUpTo,
                                         point['threshold'],
                                         colSlice,
                                         mark_color=[0, 255, 0])
     compimg = os.path.join(self.imagedir, 'colMarkedImage.png')
     compimg = np.array(Image.open(compimg))
     self.compareArrays(markedImage, compimg,
                        "Marked image is not equivalent to expected image")
Ejemplo n.º 4
0
 def test_seammarker_markSeam4Point_colSliceFalse_isUpToTrue(self):
     isUpTo = True
     colSlice = False
     demot = self.loadImageRow()
     points = loadJfile(self.points_left_path)
     point = points["2"]
     point_coord = (point['y'], point['x'])
     marker = SeamMarker(demot)
     markedImage = marker.markSeam4Point(demot,
                                         point_coord,
                                         isUpTo,
                                         point['threshold'],
                                         colSlice,
                                         mark_color=[0, 255, 0])
     # pdb.set_trace()
     compimg = os.path.join(self.imagedir, 'rowMarkedImage.png')
     compimg = np.array(Image.open(compimg))
     self.compareArrays(markedImage, compimg,
                        "Marked image is not equivalent to expected image")