matplotlib>pyplot map colors wont work

asked 2018-09-26 11:59:25 -0600

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

berak gravatar image

.

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"

edit retag flag offensive close merge delete

Comments

1

Can you post the image? Trying to reproduce it

eshirima gravatar imageeshirima ( 2018-09-26 12:52:56 -0600 )edit

pyplot uses RGB pixel order, opencv BGR.

berak gravatar imageberak ( 2018-09-27 00:38:33 -0600 )edit