Main Content

Low-Light Image Enhancement

This example shows how to brighten dark regions of an image while preventing oversaturation of bright regions.

Images can be highly degraded due to poor lighting conditions. These images can have low dynamic ranges with high noise levels that affect the overall performance of computer vision algorithms. To make computer vision algorithms robust in low-light conditions, use low-light image enhancement to improve the visibility of an image.

Read and display an RGB image captured in low light.

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

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

Localized Brightening

Brighten the low-light image in proportion to the darkness of the local region, then display the brightened image. Dark regions brighten significantly. Bright regions also have a small increase in brightness, causing oversaturation. The image looks somewhat unnatural and is perhaps brightened too much.

B = imlocalbrighten(A);
imshow(B)

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

Display a histogram of the pixel values for the original image and the brightened image. For the original image, the histogram is skewed towards darker pixel values. For the brightened image, the pixel values are more evenly distributed throughout the full range of pixel values.

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.

Brighten the original low-light image again and specify a smaller brightening amount.

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

Display the brightened image. The image looks more natural. The dark regions of the image are enhanced, but the bright regions by the windows are still oversaturated.

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

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

To reduce oversaturation of bright regions, apply alpha blending when brightening the image. The dark regions are brighter, and the bright pixels retain their original pixel values.

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

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

For comparison, display the three enhanced images in a montage.

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

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

References

[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.

See Also