Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #plt #clor #image #histogram
ADD COMMENT
Topic
Name
3+6 =