- 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?
Issues extracting fibers from an image
8 views (last 30 days)
Show older comments
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 Comment
Andreas Goser
on 3 Feb 2025
Edited: Andreas Goser
on 3 Feb 2025
I'd like understanding a bit more about the project, as it drives recommendations. Questions for a start:
Answers (1)
Image Analyst
on 28 Feb 2025
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.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!