Image enhancement MATLAB code.
Afficher commentaires plus anciens
% Adjust image intensity values or colormap.
f = imadjust(uint8(scratched_image), stretchlim(scratched_image), [0 1]);
% convert to grayscale
img_gray = rgb2gray(f);
% Create morphological structuring element
se = strel('disk',12);
% Top-hat filtering.
th_fhiltered = imtophat(img_gray,se);
figure, imshow(th_fhiltered);
% Adjust image intensity values or colormap.
contrast_adjusted = imadjust(th_fhiltered);
figure, imshow(contrast_adjusted);
% 2-D median filtering
K = medfilt2(img_gray);
% Contrast-limited Adaptive Histogram Equalization
J = adapthisteq(K,'cliplimit',0.5);
% Create predefined 2-D filters
H = fspecial('average', [8 3]);
% N-D filtering of multidimensional images.
f_avg = imfilter(J,H,'replicate');
contrast_adj_image = contrast_adjusted-0.3*f_avg;
I have a few questions,
- what is the end result of this routine?
- why is top-hat filtering used with 'disk'?
- what are the last two lines doing?
- Why 'replicate' is used?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Image Processing Toolbox dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

