# 自适应直方图均衡化
def hisEqulColor(img):
# 将RGB图像转换到YCrCb空间中
ycrcb = cv.cvtColor(img, cv.COLOR_BGR2YCR_CB)
channels = cv.split(ycrcb)
clahe = cv.createCLAHE(clipLimit=1.0, tileGridSize=(7, 7))
clahe.apply(channels[0], channels[0])
cv.merge(channels, ycrcb)
cv.cvtColor(ycrcb, cv.COLOR_YCR_CB2BGR, img)
return img
直方图均衡化
于 2023-07-02 01:20:29 首次发布