Nice Overlay of Binary Mask on Raw Image
### Nice Overlay of Binary Mask on Raw Image
# Init
plt.figure(figsize=(10,10))
# Background: the raw image
plt.imshow(img, interpolation='none', cmap='gray')
# Foreground: the binary membrane mask
# Note: `np.ma.array` ensures that the background regions are masked away
# and `alpha` makes the image semi-transparent.
plt.imshow(np.ma.array(mem_final, mask=~mem_final),
interpolation='none', cmap='autumn', alpha=0.4)
# Done
plt.show()
Edited by Jonas Hartmann