how to identify the cracks from the image
Show older comments

3 Comments
KALYAN ACHARJYA
on 24 Aug 2018
Have you tried so far? For that, you have to do some sorts of coding. How to get the fast and proper answer here
ASIM BISAYEE
on 26 Aug 2018
ASIM BISAYEE
on 26 Aug 2018
Answers (2)
Image Analyst
on 26 Aug 2018
1 vote
Try something like a bottom hat filter, imbothat(), then threshold and use regionprops() to thrown out blobs that are vertical. If a slanted crack touches a vertical crack, then you'll have to split them apart with something like watershed.
10 Comments
ASIM BISAYEE
on 26 Aug 2018
Image Analyst
on 26 Aug 2018
It would probably take more time than I can donate to you, if I were to write a turnkey solution for this. You can see my Image Segmentation Tutorial to get started. https://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862&sort=downloads_desc
Other than that you can take horizontal and vertical profiles
verticalProfile = mean(grayImage, 2);
horizontalProfile = mean(grayImage, 1);
to try to find the straight lines, which will appear as dips in the profiles. I've done this before so search the forun for "horizontalProfile". Try to find those line and then use regionfill() or something to try to fill them in with the surrounding gray levels and make them disappear. Then all you should have left are the lines at angles.
ASIM BISAYEE
on 26 Aug 2018
Edited: Image Analyst
on 26 Aug 2018
Image Analyst
on 26 Aug 2018
See my answer to a similar image in this post: https://www.mathworks.com/matlabcentral/answers/410317-how-to-detect-a-specific-image-object-and-the-crop-object-from-the-input-images#comment_591802
ASIM BISAYEE
on 26 Aug 2018
ASIM BISAYEE
on 26 Aug 2018
Image Analyst
on 26 Aug 2018
Yes, I know that already.
If you need it right away and don't want to write it yourself, the Mathworks will happily write it for you. See this link But it's not something that is a quick 5-minute solution that I'm going to bang out for you on a Sunday afternoon.
Of course you could just do manual inspection with imfreehand(), and if the crack detection is really what's important to you rather than developing an image analysis algorithm, then you can do that.
What is this material anyway? If it's semiconductor surfaces, you can look at KLA Tencor which makes semiconductor image analysis systems.
ASIM BISAYEE
on 27 Aug 2018
Image Analyst
on 27 Aug 2018
Edited: Image Analyst
on 28 Aug 2018
I understand. You're main goal is "trying to develop an algorithm" (programming) rather than material science. Like developing the algorithm is a main part of your Masters thesis or Ph.D. dissertation. So you don't want to buy, or have someone give you, the algorithm because you need to develop it yourself, for your degree. Good luck. Perhaps what I gave you might be a good start.
ASIM BISAYEE
on 29 Aug 2018
Preetham Manjunatha
on 7 Jan 2025
Edited: Preetham Manjunatha
on 16 May 2025
0 votes
The image looks quite intricate with regular structures like lines. As @Image Analyst mentioned morphological methods might help to mitigate the non-cracks entities. Here is the MATLAB Crack segmentation and Crack width, length and area estimation codes to calculate/estimate the crack area, width and length. Please try with the morphological crack detection method to get started with. Gradient-based crack segmentation methods can pick the lines heavily in comparision to the morohological approach. Lastly, the semantic segmentation and object detection metrics for the cracks can be found using Cracks binary class bounding box and segmentation metrics package.
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!