失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > Python+OpenCV:图像对比度受限自适应直方图均衡化(CLAHE Contrast Limited Adap

Python+OpenCV:图像对比度受限自适应直方图均衡化(CLAHE Contrast Limited Adap

时间:2018-10-24 16:39:45

相关推荐

Python+OpenCV:图像对比度受限自适应直方图均衡化(CLAHE  Contrast Limited Adap

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》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。