How can I extract the crack from the noise and human drawn grid lines?
Show older comments
I am writing a program that is going to detect cracks from a concrete specimen image. The image has human-drawn grid lines by default, and these grid lines are going to curve because of a hydraulic press from above. After filtering the noise and grid lines, I plan to extract the cracks, create bounding boxes, and then draw the skeleton in the middle of the crack contour. Following this, I will measure the crack width and length using an edge pixel searching process. Here is my code so far.
%convert to grayscale
gs = im2gray(img);
%adjust the histogram
gsAdj = imadjust(gs);
%apply gaussian blur
filterSize = 5;
sigma = 1; % standard deviation of the Gaussian kernel
G = fspecial('gaussian', filterSize, sigma);
I_blur = imfilter(gs, G, 'same'); % apply the filter
BW2 = edge(I_blur,'canny');
imshow(BW2)
imwrite(BW2,"bw_canny.jpg")


I am new to image processing, I am looking for ways to filter out noise and grid lines from my images. I am particularly interested in techniques that can help me identify grid markings in a binary image and change their pixel values from 1 to 0. Any advice on this would be greatly appreciated.
Accepted Answer
More Answers (1)
Mathieu NOE
on 16 Jun 2025
Moved: Matt J
on 16 Jun 2025
1 vote
the crack detection topic is not a new subject... maybe you should try one of these solutions (quick search) :
and probably a lot more if you search longer than me...
1 Comment
Categories
Find more on Denoising and Compression 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!