主要内容

低光照图像增强

此示例说明如何增亮图像的暗区,同时防止亮区过饱和。

图像可能因光照条件差而严重退化。这些图像可能具有低动态范围和高噪声电平,这会影响计算机视觉算法的整体性能。为了使计算机视觉算法在低光照条件下具有稳健性,请使用低光照图像增强来提高图像的可见性。

读取并显示在低光照下拍摄的 RGB 图像。

A = imread("lowlight_1.jpg");
imshow(A)
title("Original Image")

Figure contains an axes object. The hidden axes object with title Original Image contains an object of type image.

局部增亮

根据局部区域的暗度增亮低光照图像,然后显示增亮后的图像。暗区显著增亮。亮区亮度也稍有增加,导致过饱和。图像看起来有些不自然,并且可能增亮过度。

B = imlocalbrighten(A);
imshow(B)

Figure contains an axes object. The hidden axes object contains an object of type image.

显示原始图像和增亮后图像的像素值直方图。对于原始图像,直方图偏向较暗的像素值。对于增亮后的图像,像素值在整个像素值范围内分布更均匀。

figure
subplot(1,2,1)
imhist(A)
title("Original Image")
subplot(1,2,2)
imhist(B)
title("Brightened Image")

Figure contains 4 axes objects. Axes object 1 with title Original Image contains an object of type stem. Axes object 2 contains 2 objects of type image, line. Axes object 3 with title Brightened Image contains an object of type stem. Axes object 4 contains 2 objects of type image, line.

再次增亮原始低光照图像,并指定较小的增亮量。

amt = 0.5;
B2 = imlocalbrighten(A,amt);

显示增亮后的图像。图像看起来更自然。图像的暗区得到增强,但窗口附近的亮区仍过饱和。

figure
imshow(B2)
title("Image with Less Brightening")

Figure contains an axes object. The hidden axes object with title Image with Less Brightening contains an object of type image.

为了减少亮区的过饱和,在增亮图像时应用 alpha 混合。暗区更亮,而亮像素保留其原始像素值。

B3 = imlocalbrighten(A,amt,AlphaBlend=true);
imshow(B3)
title("Image with Alpha Blending")

Figure contains an axes object. The hidden axes object with title Image with Alpha Blending contains an object of type image.

为了进行比较,以蒙太奇方式显示三张增强后的图像。

figure
montage({B,B2,B3},Size=[1 3],BorderSize=5,BackgroundColor="w")

Figure contains an axes object. The hidden axes object contains an object of type image.

参考

[1] Dong, X., G. Wang, Y. Pang, W. Li, J. Wen, W. Meng, and Y. Lu. "Fast efficient algorithm for enhancement of low lighting video." Proceedings of IEEE® International Conference on Multimedia and Expo (ICME). 2011, pp. 1–6.

另请参阅