Grayscale image lighting enhancement

This function performs lighting enhancement on grayscale images using simple filters.
244 téléchargements
Mise à jour 15 août 2018

Afficher la licence

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

Citation pour cette source

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

Compatibilité avec les versions de MATLAB
Créé avec R2016a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
1.0.0