Python+OpenCV:图像对比度受限自适应直方图均衡化(CLAHE, Contrast Limited Adaptive Histogram Equalization)
##################################################################################################### 图像对比度受限自适应直方图均衡化(CLAHE, Contrast Limited Adaptive Histogram Equalization)def lmc_cv_image_clahe():"""函数功能: 图像对比度受限自适应直方图均衡化(CLAHE, Contrast Limited Adaptive Histogram Equalization)。"""stacking_images = []# 图像对比度受限自适应直方图均衡化(CLAHE, Contrast Limited Adaptive Histogram Equalization)image_file_name = ['D:/99-Research/Python/Image/Photo1.jpg', 'D:/99-Research/Python/Image/Photo2.jpg','D:/99-Research/Python/Image/Photo3.jpg', 'D:/99-Research/Python/Image/Lena.jpg']for i in range(len(image_file_name)):# 读取图像image = lmc_cv.imread(image_file_name[i])image = lmc_cv.cvtColor(image, lmc_cv.COLOR_BGR2GRAY)# create a CLAHE object (Arguments are optional).clahe = lmc_cv.createCLAHE(clipLimit=2.0, tileGridSize=(8, 8))clahe_image = clahe.apply(image)# stacking images side-by-sidestacking_image = np.hstack((image, clahe_image))stacking_images.append(stacking_image)# 显示图像pyplot.figure('CLAHE, Contrast Limited Adaptive Histogram Equalization')for i in range(len(stacking_images)):pyplot.subplot(2, 2, i + 1)pyplot.imshow(stacking_images[i], 'gray')pyplot.xticks([])pyplot.yticks([])pyplot.show()# 根据用户输入保存图像if ord("q") == (lmc_cv.waitKey(0) & 0xFF):# 销毁窗口pyplot.close()return
Python+OpenCV:图像对比度受限自适应直方图均衡化(CLAHE Contrast Limited Adaptive Histogram Equalization)
如果觉得《Python+OpenCV:图像对比度受限自适应直方图均衡化(CLAHE Contrast Limited Adap》对你有帮助,请点赞、收藏,并留下你的观点哦!