Crack width measurement on binary images

8 次查看(过去 30 天)
I have a bunch of binary pictures showing different cracks with more or less complex geometries (see attached file). I would like to measure the crack width along the crack length (perpendicularly to the crack direction, not horizontally). When the crack branches into two or more thinner cracks I would like to measure the individual width of each crack (note that the crack edges are very irregular and the cracks are sometimes interrupted by small defects such as air bubbles).

采纳的回答

Image Analyst
Image Analyst 2015-6-13
I would call bwdist() to get the distance transform.
edtImage = bwdist(binaryImage);
Then call
skelImage = bwmorph(binaryImage, 'skel', inf);
to get the skeleton. Then multiply those two together.
crackWidthImage = 2 * double(edtImage) .* double(skelImage);
This will give you the radius (half width) at each location, then multiply by 2 to get the full width. Now you have "the individual width of each crack" just as you asked for. Of course the width is different depending on where along the crack you decide to measure it.
Not sure what you want to do after this. You can inspect a certain point to find out the width there. Or you can take the histogram of the skeletonized distance transform if you want a distribution of crack widths over the entire image.
  4 个评论
KAMOOSH BABA SHAIK
Sir provide me complete code for to detect crack in a image and also to find crack length and width.
Image Analyst
Image Analyst 2021-6-8
@KAMOOSH BABA SHAIK, try my Image Segmentation Tutorial in my File Exchange. If you have a simple case of light cracks on a dark background or dark cracks on a bright background, you can easily modify it to use your own images.

请先登录,再进行评论。

更多回答(4 个)

Walter Roberson
Walter Roberson 2015-6-13
Possibly :
imdilate() to connect across small breaks. Take the result and skeletonize it. Then from each "tip" of the skeleton, ask for the geodesic path back to a starting point. That path gives you implicit crack direction information.
But unfortunately the path is going to be pixelated, so at any one point you are going to want a bit of information about the previous and next pixel locations in order to determine your direction vector; the further back and further forward you look the more accurately you would be able to determine the slope of a long segment, but the more likelihood that you will encounter a curve in the path.
Supposing that you do create a function that can tell you the direction vector anywhere along the path, given the pixel list, to a satisfactory resolution. Then go back to the original image, and follow the path along it, take perpendicular to the direction, extend it in each direction until it hits the edge of the crack, total the length of the two sides, and that should be the width.
For direction vector (x,y) the perpendicular is (-y,x) or (y,-x)

Mohd Nasim
Mohd Nasim 2017-10-6
hello....i m doing project on crack detection in concrete, and i am unable to find crack width and length of crack in concrete...so...Plz send the matlab code for crack width and crack length for any surface.or provide me the source where i will get it...

roni oz
roni oz 2021-6-11
Hi
I'm doing work on this subject.
I would be happy if you could share the process for me too.
Thanks,
Roni

Aishwarya
Aishwarya 2023-2-17
hello....i m doing project on crack detection in concrete, and i am unable to find crack width and length of crack in concrete...so...Plz send the matlab code for crack width and crack length for any surface.or provide me the source where i will get it...

Community Treasure Hunt

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

Start Hunting!

Translated by