Histograms – OpenCV 3.4 with python 3 Tutorial 11
by
Sergio Canu
Beginners Opencv, Tutorials
Source code:
[python]
import cv2
import numpy as np
from matplotlib import pyplot as plt
img = cv2.imread("sea_beach.jpg")
b, g, r = cv2.split(img)
cv2.imshow("img", img)
cv2.imshow("b", b)
cv2.imshow("g", g)
cv2.imshow("r", r)
plt.hist(b.ravel(), 256, [0, 256])
plt.hist(g.ravel(), 256, [0, 256])
plt.hist(r.ravel(), 256, [0, 256])
plt.show()
[/python]
Files:
Hi there, I’m the founder of Pysource.
I help Companies, Freelancers and Students to learn easily and efficiently how to apply visual recognition to their projects.
For Consulting/Contracting Services, check out this page.