def plot_segmentation(I,GT,Seg, fig=None):
I = np.squeeze(I)
GT = np.squeeze(GT)
Seg = np.squeeze(Seg)
GTC = np.logical_and(GT, np.logical_not(ndimage.binary_erosion(GT)))
SegC = np.logical_and(Seg, np.logical_not(ndimage.binary_erosion(Seg)))
plt.figure(fig)
maskedGT = np.ma.masked_where(GTC == 0, GTC)
maskedSeg = np.ma.masked_where(SegC == 0, SegC)
plt.imshow(I, cmap=cm.gray)
plt.imshow(maskedGT, cmap=cm.jet, interpolation='none')
plt.imshow(maskedSeg*100, cmap=cm.hsv, interpolation='none')
评论列表
文章目录