def generateSlicedImage(self): if self.GEN_SLICE_IMAGE: viet = self.loadImageCol() m1 = os.path.join(self.npdir, 'matchedMarkCoordPair1ColSliceTrueDown.npy') m1 = np.load(m1) m2 = os.path.join(self.npdir, 'matchedMarkCoordPair2ColSliceTrueDown.npy') m2 = np.load(m2) marker = SeamMarker(viet) colSlice = True swaped = marker.swapAndSliceMarkCoordPair(m1, m2, viet, colSlice) Image.fromarray(swaped).save(self.sliceImagePath)
def test_seammarker_swapAndSliceMarkCoordPair_down_colSliceTrue(self): viet = self.loadImageCol() # pdb.set_trace() m1 = os.path.join(self.npdir, 'matchedMarkCoordPair1ColSliceTrueDown.npy') m1 = np.load(m1) m2 = os.path.join(self.npdir, 'matchedMarkCoordPair2ColSliceTrueDown.npy') m2 = np.load(m2) marker = SeamMarker(viet) colSlice = True swaped = marker.swapAndSliceMarkCoordPair(m1, m2, viet, colSlice) # pdb.set_trace() compimg = os.path.join(self.imagedir, 'slicedImage.png') compimg = np.array(Image.open(compimg)) self.compareArrays(compimg, swaped, "Image slicing with mark coordinate has failed")