Grayscale image lighting enhancement

版本 1.0.0 (3.2 KB) 作者: Santiago Benito
This function performs lighting enhancement on grayscale images using simple filters.
248.0 次下载
更新时间 2018/8/15

查看许可证

The functions works by substracting a filtered image called the background image from the original image to obtain a corrected version of the latter. The background image contains the illumination gradient and therefore allows the correction of the original picture. The function only works on grayscale images and the user must manually input if the foreground is brighter or darker than the background.

The filters employed are the most simple out there: the minimum and maximum filters. Maximum and minimum filters attribute to each pixel in an image a new value equal to the maximum or minimum value in a neighborhood around that pixel, respectively. Therefore by selecting a neighborhood, or structuring element in this case, which best fits each applycation very good results are obtained.

Here are the lines present in the example in the code. To see the code in action, just download it and then execute the following lines in the path where the function is present:
I = imread('printedtext.png');
SE = strel('rectangle',[150,15]);
I_leveled = imgrayenhance(I,'dark',0.8,SE,true);
BW = imbinarize(I_leveled,0.75);
subplot(2,2,4)
imshow(BW)
title('Binarized image')

More information about each of these lines is present in under EXAMPLE in the given code.

Contact: santiago.benito@rub.de

引用格式

Santiago Benito (2024). Grayscale image lighting enhancement (https://www.mathworks.com/matlabcentral/fileexchange/68495-grayscale-image-lighting-enhancement), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2016a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0