Issues extracting fibers from an image

Dear Community,
I am trying to extract fibers from a microscopy image:
My most succesfull try looks like this:
image = imread(imagepath);
image = rescale(image);
image = imgaussfilt(image, 0.7);
image = adapthisteq(image, 'NumTiles',[100 100],'ClipLimit',0.1, 'NBins', 100);
T = adaptthresh(image,0.9);
image = imbinarize(image,T);
Which results in
As you can see, not all lines are found, and some background noise is wrongfully included. I have also tried edgedetection using all the included algorithms using
methods = {"Sobel", "Prewitt","Roberts","log","zerocross","Canny"};
for k = 1:length(methods)
tmp= adapthisteq(image, 'NumTiles',[200 200],'ClipLimit',0.1, 'NBins', 100);
[~,threshold] = edge(tmp,methods{k});
fudgeFactor = 0.7;
edge_detected = edge(tmp,methods{k},threshold * fudgeFactor);
end
all with unconnected lines like in the image below:
Since this is not really my field, I am now running out of ideas. I have played around with morphological operations and skelletonizing, but to no avail. Next I will probably look at specialized software and seed growing approaches, but I wanted to try asking the community first in case I was missing something obvious.
Thank you for your time and Help!

1 comentario

Andreas Goser
Andreas Goser el 3 de Feb. de 2025
Editada: Andreas Goser el 3 de Feb. de 2025
I'd like understanding a bit more about the project, as it drives recommendations. Questions for a start:
  • Do you have control over the quality of the image yourself, or at least can communicate with the person having control? Or is it handed to you and you need to live with what you get?
  • Is this a one-off analysis, or are there more pictures to analyze?
  • Anything you can tell us about the real-life application and/or the goal of the analysis? Like "pictures are taken while producing xyz every minute and once the cumulative fiber area exceeds abc, the production needs to be stopped".
  • Any plans leveraging Deep Learning?
  • "Specicalized Software" is mostly "canned", meaning you might get results, but have no idea why. You have something in mind?

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 28 de Feb. de 2025

0 votos

The attached demo, while not a complete solution for you, may be helpful in enhancing the fibers.
Sorry, but it's all I have time for at the moment.

1 comentario

Djaik
Djaik el 3 de Mzo. de 2025
thank you, thats already super helpfull. I tried using imopen to no great effect for the image cleaning, but since we will be wanting the orientation at a later point, this is good to have in our back pocket! I am currently using imgaussian by D. Kroon to good effect and will iterate on it when I have more time!

Iniciar sesión para comentar.

Categorías

Productos

Versión

R2024b

Preguntada:

el 30 de En. de 2025

Comentada:

el 3 de Mzo. de 2025

Community Treasure Hunt

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

Start Hunting!

Translated by