extracting area of cracks from image
Mostrar comentarios más antiguos
Dear all, I wrote this code to extract cracks from a tomography image. I tried many ways to remove the background and enhance the colors for better crack extraction, but some cracks are still missing. Can anyone help me improve the code?
clear all
close all
clc
A= imread('image_1567.png');
[rows, columns, numberOfColorChannels] = size(A);
[centers,radii] = imfindcircles(A,[500 650],Sensitivity=0.95);
mask = circles2mask(centers,radii,size(A));
new_image = A;
new_image(~mask) = nan;
figure(1)
sigma = 20;
Iflatfield = imflatfield(new_image,sigma);
imshow(Iflatfield)
figure(2)
imhist(Iflatfield);
figure(3)
crackMask = Iflatfield < 50;
imshow(crackMask)
Respuesta aceptada
Más respuestas (1)
Rahul
el 19 de Jul. de 2024
1 voto
Hi @Elisa
In addition to your provided code to extract areas including cracks from the given image, you can make use of image processing techniques like Adaptive Histogram Equalization and Median Filtering to enhance the contrast of the image to better identify the crack areas.
You can do this by using 'adapthisteq' and 'medfilt2' functions respectively.
You can refer to this link to know more about their functionalities:
You might also consider tweaking the threshold value that you have defined as 50. This can help you get your desired result.
Hope this helps!
Categorías
Más información sobre Image Filtering and Enhancement en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!