Ask Your Question

Revision history [back]

matplotlib>pyplot map colors wont work

import cv2 from matplotlib import pyplot as plt import numpy as np

img1= cv2.imread('hristos_karaiskos.jpg')

img1= img[:,:,::-1]

replicate= cv2.copyMakeBorder(img1,10,10,10,10,cv2.BORDER_REPLICATE)

plt.subplot(231) plt.imshow(img1, 'Pastel1') plt.subplot(232) plt.imshow(replicate,'gray') plt.show()

My image wont change color, not or the "pastel1" not to the 'gray"

click to hide/show revision 2
None

updated 2018-09-26 12:02:04 -0600

berak gravatar image

matplotlib>pyplot map colors wont work

.

import cv2
from matplotlib import pyplot as plt
import numpy as np

np

img1= cv2.imread('hristos_karaiskos.jpg')

cv2.imread('hristos_karaiskos.jpg') #img1= img[:,:,::-1]

img1= img[:,:,::-1]

replicate= cv2.copyMakeBorder(img1,10,10,10,10,cv2.BORDER_REPLICATE)

replicate= cv2.copyMakeBorder(img1,10,10,10,10,cv2.BORDER_REPLICATE)

plt.subplot(231) plt.imshow(img1, 'Pastel1') plt.subplot(232) plt.imshow(replicate,'gray') plt.show()

plt.show()

My image wont change color, not or the "pastel1" not to the 'gray"