Classifying grainy and defected marbles

1 view (last 30 days)
matlablearner
matlablearner on 14 May 2021
Commented: matlablearner on 19 May 2021
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
Image Analyst on 19 May 2021
See my Image Segmentation Tutorial in my File Exchange.
Adapt it to use your image.
matlablearner
matlablearner on 19 May 2021
Thanks for answering, but the tutorial is complicated for me. How should I adapt it to my image to segment it into cracks and veins?

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!