How to calculate the length of the longest crack in this image automatically ?

How to highlight those cracks in this image and calculate their lengths?

2 件のコメント

Image Analyst
Image Analyst 2024 年 12 月 26 日
編集済み: Image Analyst 2024 年 12 月 26 日
It's complicated by the fact that the really long crack crosses over dark circular regions. Do you consider the crack to end when it hits a round dark region? Or do you want it to continue through it? Please annotate the image with red lines showing exactly where each crack is.

サインインしてコメントする。

 採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2024 年 12 月 29 日
編集済み: KALYAN ACHARJYA 2024 年 12 月 29 日
img = imread('image_crack.png');
% Enhance contrast
enhancedImg = imadjust(grayImg);
% Apply Gaussian filter to reduce noise
smoothedImg = imgaussfilt(enhancedImg, 2);
% Binarize the image using a manually set threshold
binaryImg = imbinarize(smoothedImg,0.32);
%figure, imshow(binaryImg);
%get the highest blob
BW = bwareafilt(~binaryImg,1);
figure,imshow(BW);
Appooximate Only: Now, attempt to use a skeleton-based approach or approximating triangles to determine spatial coordinates and calculate the distances.

その他の回答 (0 件)

カテゴリ

製品

リリース

R2024b

質問済み:

2024 年 12 月 25 日

コメント済み:

2025 年 1 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by