Grayscale image lighting enhancement

This function performs lighting enhancement on grayscale images using simple filters.
248 download
Aggiornato 15 ago 2018

Visualizza la licenza

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

Cita come

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

Compatibilità della release di MATLAB
Creato con R2016a
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.0.0