本文主要是介绍histograms equalization by python-opencv,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在HSV空间做局部直方图均衡化对比度增强
import cv2
import numpy as npimg = cv2.imread('Lenna.png')
img = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)s, v, h = cv2.split(img)
# cv2.imwrite('h.jpg', h)# create a CLAHE object (Arguments are optional).
clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8, 8))
h = clahe.apply(h)
# cv2.imwrite('h-cla.jpg', h)hsv_img = cv2.merge([s,v,h])
out = cv2.cvtColor(hsv_img,cv2.COLOR_HSV2BGR)cv2.imwrite('Lenna_out.png', out)
这篇关于histograms equalization by python-opencv的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!