Classifying grainy and defected marbles
1 view (last 30 days)
Show older comments
Hello everyone, i'm trying to classify grainy texture and defects on marbles. The code should understand the differences between grainy textures and cracks.
In the code, it finds all the textures. How can I distinguish cracks from grainy texture. Can anyone help me?
i=imread('image1.jpg');
figure
imshow(i)
title('Original image before processing')
I = rgb2gray(i);
bw = edge(I, 'Canny', 0.27);
figure
imshow(bw)
title('Edges of Original Image Canny Method')
BW_out = bwpropfilt(bw, 'Area', [150 + eps(200), Inf]);
BW_out = bwpropfilt(BW_out, 'Perimeter', [70 + eps(100), Inf]);
properties = regionprops(BW_out, {'Area', 'Eccentricity', 'EquivDiameter', 'EulerNumber', 'MajorAxisLength', 'MinorAxisLength', 'Orientation', 'Perimeter'});
figure
imshow(BW_out)
title('Crack extracted')
5 Comments
Image Analyst
on 19 May 2021
See my Image Segmentation Tutorial in my File Exchange.
Adapt it to use your image.
Answers (0)
See Also
Categories
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!