简体   繁体   English

如何在RGB图像中的阴影像素中消除阴影的影响

[英]How do I remove effects of shadow in shadowed pixels in RGB images Python

I have high resolution ground cover RGB images with varying levels of shadow present. 我有高分辨率的地面覆盖RGB图像,并且阴影水平各不相同。 How can I pre-process them to remove the shadow effects (enhance shadowed pixels). 我如何对其进行预处理以消除阴影效果(增强阴影像素)。 Shadows mainly arise from rocks, tripod, and plants. 阴影主要来自岩石,三脚架和植物。 Below are some examples (screencaptures of the actual images). 下面是一些示例(实际图像的屏幕截图)。

image1 , image2 , image3 image1image2image3

After a second look - it appears that it would be very beneficial if the tiny shadows (eg created from small leaves, branches, small rocks) were also enhanced - I assume the solution would pick these up as well. 再看一遍-如果细微的阴影(例如,由小树叶,树枝,小石头所形成的阴影)也得到增强,那将是非常有益的-我认为解决方案也将这些优点也包括在内。

I'm doing a model of ground cover segmentation with three classes. 我正在使用三个类别的地面覆盖物分割模型。 The model copes well when light shadow is present so I'm not worried about that. 当存在阴影时,该模型可以很好地应对,因此我不必为此担心。 The main concern is moderate levels of shadow. 主要关注的是中等水平的阴影。 I basically want to feed the hundreds of images through some code so that the final result is an RGB image with the shadowed pixels appearing to not be in shadow anymore. 我基本上想通过一些代码来提供数百张图像,以使最终结果是RGB图像,其中阴影像素似乎不再处于阴影中。

Something that increases the brightness of the shadowed pixels to match the mean brightness of the non-shadowed pixels might be a good starting idea (but I'm sure better techniques exist). 可以增加阴影像素的亮度以匹配非阴影像素的平均亮度的某件事可能是一个不错的开始(但我确信存在更好的技术)。

For the very dark shadows I plan on creating training data for a fourth class so I can detect these and remove these pixels from analysis (Assuming that very low brightness will be the main feature used here). 对于非常暗的阴影,我计划为第四类创建训练数据,以便可以检测到这些并从分析中删除这些像素(假设非常低的亮度将是此处使用的主要功能)。

Maybe something trivial as converting the color space to YUV and setting an average Y brightness would do. 将颜色空间转换为YUV并设置平均Y亮度可能很简单。 Or something like the Retinex algorithm to break off the illumination layer (including shadows). 或类似Retinex算法的方法来分割照明层(包括阴影)。 Otherwise there are also several local enhancement methods like CLAHE that may help your problem. 否则,还有一些本地增强方法(例如CLAHE)可能会帮助您解决问题。 These are my suggestions. 这些是我的建议。

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

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