March 2018
Beginner to intermediate
306 pages
9h 54m
English
Use the following steps:
import cv2import numpy as npimport matplotlib.pyplot as plt
grey = cv2.imread('../data/Lena.png', 0)cv2.imshow('original grey', grey)cv2.waitKey()cv2.destroyAllWindows()
grey_eq = cv2.equalizeHist(grey)
hist, bins = np.histogram(grey_eq, 256, [0, 255])plt.fill_between(range(256), hist, 0)plt.xlabel('pixel value')plt.show()
cv2.imshow('equalized grey', grey_eq)cv2.waitKey()cv2.destroyAllWindows()
color = cv2.imread('../data/Lena.png') ...