在openCV中使用RGB颜色(255.0,0.0,0.0)
(红色)时,输出改为蓝色。
import cv2
import matplotlib.pyplot as plt
plt.plot([1,2,3,4] , color=[1.0, 0.0, 0.0])
plt.savefig('tester.png')
img = cv2.imread('tester.png')
m_img = (cv2.line(img,(0,0),(100,100),(255.0,0.0,0.0),5))
cv2.imwrite('./update.png', m_img)
tester.png:
update.png:
如何修改线m_img = (cv2.line(img,(0,0),(100,100),(255.0,0.0,0.0),5))
以便从plt.plot([1,2,3,4] , color=[1.0, 0.0, 0.0])
绘制相同的RGB线颜色?
答案 0 :(得分:2)
OpenCV使用BGR,而不使用RGB。交换0和2频道。
removeListener()