Main Content

imlocalbrighten

Brighten low-light image

Description

B = imlocalbrighten(A) brightens low-light areas in RGB or grayscale image A.

example

B = imlocalbrighten(A,amount) brightens low-light areas in A by a specified amount.

B = imlocalbrighten(___,"AlphaBlend",alphaBlend) also specifies whether to preserve bright areas of the input image by performing alpha blending.

[B,D] = imlocalbrighten(___) also returns the darkness estimate D of each pixel in the input image.

Examples

collapse all

Read a low-light image into the workspace.

A = imread("lowlight_2.jpg");

Brighten the low-light image using the default amount of brightening. Display the original and brightened image side-by-side in a montage.

B = imlocalbrighten(A);
montage({A,B})

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

Brighten the low-light image again, this time specifying the amount of brightening to apply to the image. Display the two brightened images side-by-side in a montage.

B2 = imlocalbrighten(A,0.6);
montage({B,B2})

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

Use the AlphaBlend name-value argument to preserve content from the original image in the brightened image. View the brightened output image from the first example with the alpha blended output image. Compare the detail shown in the wall above arched entryway near the center of the image in the alpha-blended version with the original brightened image.

Bblend = imlocalbrighten(A,AlphaBlend=true);
montage({B,Bblend})

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

Get the estimated darkness per pixel. View the original image and the darkness estimate matrix.

[~,D] = imlocalbrighten(A);
montage({A,D})

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

Input Arguments

collapse all

Image to be brightened, specified as an RGB image or grayscale image.

Data Types: single | double | uint8 | uint16

Amount to brighten the image, specified as a number in the range [0, 1]. When the value is 1 (the default), imlocalbrighten brightens the low-light areas of A as much as possible. When the value is 0, imlocalbrighten returns the input image unmodified.

Example: 0.2

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Alpha blend the original and enhanced image, specified as a numeric or logical 0 (false) or 1 (true). Alpha blending combines the original image with the enhanced image to preserve brighter areas of the original image. When true, imlocalbrighten uses the estimate of darkness matrix, D, to preserve content of the input image proportional to the amount of light in each pixel.

Output Arguments

collapse all

Brightened image, returned as a numeric array of the same size and data type as the input image A.

Darkness estimate of each pixel in the input image, returned as a numeric matrix. D is the same size as the first two dimensions of the input image.

Data Types: double

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.

[2] He, Kaiming. "Single Image Haze Removal Using Dark Channel Prior." Thesis, The Chinese University of Hong Kong, 2011.

[3] Dubok Park; Hyungjo Park; David K. Han; Hanseok Ko "Single Image Dehazing with Image Entropy and Information Fidelity." ICIP, 2014.

Extended Capabilities

Version History

Introduced in R2019b

expand all