import cv2
import numpy as np
import matplotlib.pyplot as plt
img = cv2.imread('images/33.jpg')
grey = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
#直方图均衡化
equ = cv2.equalizeHist(grey)
res = np.hstack((grey,equ)) #stacking images side-by-side
# create a CLAHE object (Arguments are optional).
# 分块局部均衡化
clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8))
res1 = clahe.apply(grey)
'''
• channels=[0,1] 因为我们需要同时处理 H 和 S 两个通道。
• b
opencv学习——直方图均衡化
最新推荐文章于 2024-06-02 11:54:50 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)