segmentation of dark lines when background is darker a bit.
7 views (last 30 days)
Show older comments
Helloo, Can someone suggest me how I can do good segmentation of lines, I want to extract those darker lines. I tried normal thresholding but the background is too dark to give me a good result.
0 Comments
Accepted Answer
Image Analyst
on 25 Mar 2016
Edited: Image Analyst
on 31 Mar 2016
You can use a modification of an algorithm used to find text on varying background. Basically you scan and do a local Otsu filter. Then you scan and find the local Sobel edges, then take the std dev of that and threshold. Then AND to find only blobs that are locally varying. Then do some cleanup by finding only tall and dark blobs that are large enough. Code is attached. There are a lot of parameters in my well commented code that you can vary to achieve different effects. I've already spent way more time on this than I normally do for people, so I'll leave that to you. Good luck.
10 Comments
More Answers (2)
Guillaume
on 23 Mar 2016
im = rgb2gray(imread('test8.png'));
imshow(adapthisteq(im), []);
But there's so much you can do with a poor quality image. Better would be to improve your imaging setup to have better contrasted image (and a more uniform background).
4 Comments
See Also
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!