How to remove the smudges and noise in this image?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Duncan
le 24 Juil 2014
Réponse apportée : Image Analyst
le 25 Juil 2014
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/166153/image.jpeg)
I have the attached image of a crack. I have used the following code to remove most of the noise and blobs to leave only the crack pattern:
%binarize an image and display it
I = imread('crack3.JPG');
level = graythresh(I);
BW = im2bw(I, level);
BW1 = imcomplement(BW); %colour inversion
G = fspecial('gaussian', [5 5], 0.5); %Create the gaussian filter with hsize = [5 5] and sigma = 0.5
BW2 = imfilter(BW1,G,'same');
BW3 = bwareaopen(BW2,50); %removes objects with < 50 connected pixels
BW4 = bwmorph(BW3, 'bridge', 1);
BW5 = bwmorph(BW4, 'diag', 1);
BW6 = bwmorph(BW5, 'majority', 1);
figure, imshow(BW6)
but I am still having trouble removing some of the smudges occurring on the top left-hand corner and at various positions.
Any help would be appreciated. Thanks
Duncan
0 commentaires
Réponse acceptée
Image Analyst
le 25 Juil 2014
That's not how I'd do it. And you aren't even showing how you filled in the crack.
Anyway if you want to brighten various smudges, then use CLAHE, done by adapthisteq(). It will scan the image and make every tile roughly the same mean and standard deviation. Not like a Wallis filter, but sort of similar. You could also do a Wallis filter, if you can find code for that. Another method is to blur the image to get rid of fine texture and noise and then divide your image by the blurred one. Yet another one (one that I use) is to use John D'Errico's polyfitn() to create a smooth model background and then divide your image by the smoothed model background. I've attached a demo for that. Or you can look at shadow removal methods, like that invented at the University of Dayton http://www.udayton.edu/engineering/vision_lab/video_preprocessing/nonlinear_enchancement.php
0 commentaires
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!