Crack width measurement on binary images
조회 수: 5 (최근 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).
댓글 수: 0
채택된 답변
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
2021년 6월 7일
Sir provide me complete code for to detect crack in a image and also to find crack length and width.
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.
추가 답변 (5개)
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)
댓글 수: 0
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...
댓글 수: 0
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
댓글 수: 0
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...
댓글 수: 1
Image Analyst
2023년 2월 17일
Try thresholding. Or else look for asphalt or concrete. It's been asked before. Or else try http://www.visionbib.com/bibliography/contents.html
and
also search for crack, asphalt, etc.
Preetham Manjunatha
2024년 12월 19일
Here is the MATLAB code to calculate/estimate the crack area, width and length. In addition, this package assumes the crack is segmented either using morphological method or multiscale gradient-based or deep learning semantic segmentation methods. This package estimates the crack area, width and length (pixel scale can be provided to estimate these physical quantities).
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!