简体   繁体   English

增强彩色图像对比度的好方法是什么?

[英]What is a good way of Enhancing contrast of color images?

I split color image for 3 channels and made a contrast enhancement of each channel. 我将彩色图像分为3个通道,并增强了每个通道的对比度。 Then merged them together, I like the image at the result, but it has different colors. 然后将它们合并在一起,我喜欢最终的图像,但是它具有不同的颜色。 Black objects became yellow and so on... 黑色物体变成黄色,依此类推...

EDIT: The algorithm I used is to calculate the 5th percentile and the 95th percentile as min and max values, and then expand the values of image so that it will have min and max values as 0 and 255. If there is a better approach please tell me. 编辑:我使用的算法是计算第5个百分位数和第95个百分位数作为最小值和最大值,然后扩展图像的值,以便它将最小值和最大值设为0和255。如果有更好的方法,请告诉我。

When doing contrast enhancement in color images, it is a good idea to only adjust the luminance (brightness) and leave the color information alone. 在彩色图像中进行对比度增强时,最好仅调整亮度(亮度),而不要保留色彩信息。 This requires a colorspace conversion from RGB to something like YUV . 这需要从RGB到YUV之类的颜色空间转换。 In this colorspace, the Y component is similar to a grayscale version of the image, while the other components provide the color. 在此色彩空间中,Y分量类似于图像的灰度版本,而其他分量提供颜色。 This effectively allows you to adjust contrast (by running your algorithm on just the Y component) without distorting the color information. 这有效地允许您调整对比度(通过仅在Y分量上运行算法)而不会扭曲颜色信息。 Finally, you can convert back to RGB. 最后,您可以转换回RGB。

Use CLAHE algorithm. 使用CLAHE算法。 openCV has an implementation of it: cv::createCLAHE() openCV有一个实现:cv :: createCLAHE()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM