I tried to run the graph cut algorithm for a slice of an MRI after converting it into PNG format. I keep encountering the following problem:
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).
This is even after setting vmin and vmax as follows:
vmin
vmax
plt.imshow(out, vmin=0, vmax=255)
Cast the image to np.uint8 after scaling [0, 255] range will dismiss this warning. It seems like a feature in matplotlib, as discussed in this issue.
np.uint8
[0, 255]
matplotlib
plt.imshow((out * 255).astype(np.uint8))
1.4m articles
1.4m replys
5 comments
57.0k users