Search
 
SCRIPT & CODE EXAMPLE
 

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()
Comment

PREVIOUS NEXT
Code Example
Python :: ignore transformers warning 
Python :: how to randomize words with pyautogui 
Python :: min_max_scaler.fit_transform 
Python :: predict probabilities with xg boost 
Python :: argmax change dafault value for multiple maxima 
Python :: write in file python 
Python :: if function has no argument python 
Python :: python debugger online 
Python :: pandas convert text duration to minutes 
Python :: Lists and for loops 
Python :: knowledgegraph dependencies 
Python :: python hasattr function 
Python :: django extract array from post matrix 
Python :: pivot_table indexing 
Python :: binary table dataframe 
Python :: qcut and cut function in python stack overflow 
Python :: pd assign index from different df 
Python :: bootstrap 5 in django 
Python :: python create dynamic 2d array 
Python :: pyyhon SHA512 hash with key 
Python :: performance of extend vs append loop 
Python :: list exaple in python 
Python :: pd df pivot 
Python :: python code to open an application 
Python :: sort an array in python 
Python :: mute command discord.py 
Python :: python endless loop 
Python :: how to make one list from nested list 
Python :: python how to draw a rectangle 
Python :: semaphore in python 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =