Finding crack path using image processing

조회 수: 6 (최근 30일)
waqas 2021년 1월 25일
답변: Anmol Dhiman 2021년 2월 3일
I have previously asked a question of this forum (link to it) where I want to find the path of a crack using image processing. However, the same method is not working for my current implementation. Following the is the sample code (for the attached .mat file) that I am using:
Igray = mat2gray(V);
th = multithresh(Igray,2);
Iseg = imquantize(Igray,th);
se = strel('disk',1);
BW1 = bwperim(Iseg == 1);
BW1 = imdilate(BW1,se);
BW2 = bwperim(Iseg == 2);
BW2 = imdilate(BW2,se);
BW3 = bwperim(Iseg == 3);
BW3 = imdilate(BW3,se);
In another implementation, I get the results as shown in the figure below but they are not what I am looking for either. This figure is based on another method which is not robust.
How can make the code more robust to use the field in the mat file so that it would work for different cases?

답변 (1개)

Anmol Dhiman
Anmol Dhiman 2021년 2월 3일
Hi Waqas,
The approach mentioned in the attached questions.seems robust enough and it should work for most of the cases.
There is no general approach for all images. It can happen that same approach might not give results for some images.
Try on multiple images to determine effectiveness of an approach.
Hope it helps

Community Treasure Hunt

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

Start Hunting!

Translated by