简体   繁体   English

Photoshop中自动对比度功能背后的算法

[英]Algorithm Behind Auto Contrast Feature in Photoshop

I am struggling with pre-processing images in image recognition. 我正在努力在图像识别中预处理图像。

Up to now, I have tried: 到目前为止,我已经尝试过:

But recently I compared CLAHE with the Auto Contrast feature of Photoshop on gray scale images - and results of Auto Contrast are impressive. 但最近我比较用Photoshop对灰度图像自动对比度功能CLAHE -和自动对比的结果令人印象深刻。 I am excited to know about algorithm behind this feature. 我很高兴知道此功能背后的算法。

Note : I know that Photoshop is proprietary software, and its code may be closed source. 注意 :我知道Photoshop是专有软件,其代码可能是封闭源。 So any hint related to improving the CLAHE results, or any other algorithm, would be by me appreciated. 因此,与改善CLAHE结果有关的任何提示,或任何其他算法,都将受到我的赞赏。

While CLAHE Algorithm is local by nature Photoshop's Auto Contrast is probably a global method. 尽管CLAHE算法本质上是局部的,但Photoshop的自动对比度可能是一种全局方法。

I'd say it works on the Histogram of the image only by stretching the values in the image - Image Normalization . 我想说的是,只有通过拉伸图像中的值( 图像归一化),它才能对图像的直方图起作用。
For instant, take RGB image and for each channel stretch its histogram as following (MATLAB Code): 即时获取RGB图像,并为每个通道按以下方式拉伸其直方图(MATLAB代码):

for ii = 1:numChannels
    mOutputImage(:, :, ii) = (mOutputImage(:, :, ii) - max(max(mOutputImage(:, :, ii)))) ./ (max(max(mOutputImage(:, :, ii))) -  min(min(mOutputImage(:, :, ii))));
end

Another approach would be Histogram Equalization . 另一种方法是直方图均衡

Probably Photoshop is doing something more Advanced. Photoshop可能正在做一些更高级的操作。
Maybe like doing it in the YUV Color Space, mixing the two or using more robust methods which looks on the percentiles of the histogram. 可能喜欢在YUV色彩空间中做到这一点,将两者混合或使用更强健的方法来查看直方图的百分位数。

But this is the direction you should experiment with. 但这是您应该尝试的方向。

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

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