Answers for "plt clor image histogram"

0

plt clor image histogram

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

file0 = 'image.jpg'
img = cv2.imread(file0)
color = ('b','g','r')
plt.figure()
for i,col in enumerate(color):
    histr = cv2.calcHist([img],[i],None,[256],[0,256])
    plt.plot(histr,color = col)
    plt.xlim([0,256])
plt.show()
Posted by: Guest on September-21-2021

Python Answers by Framework

Browse Popular Code Answers by Language