Looks like you're probably using matplotlib
to display your image. When you do that, make sure you use a grey colormap. The default is Viridis
(see docs), which is the blue-yellow colormap you're seeing
plt.imshow(grey_img, cmap = "gray")
plt.show()
As noted in the imshow
docs , pseudocolor will be added according to the colormap when you pass a 2D array:
The input may either be actual RGB(A) data, or 2D scalar data, which will be rendered as a pseudocolor image. For displaying a grayscale image set up the colormapping using the parameters cmap='gray', vmin=0, vmax=255.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.