سلام
من کد زیر را بر رسم هیستوگرام با matplotlib انجام دادم ولی خطای زیر رخ داد:
UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
import cv2 as cv
from matplotlib import pyplot as plt
filename = r'test.jpg'
img = cv.imread(filename)
color = ('b', 'g', 'r')
for i, col in enumerate(color):
histr = cv.calcHist([img], [i], None, [256], [0, 256])
plt.plot(histr, color=col)
plt.xlim([0, 256])
plt.show()