I have a question about Image Processing. I will give a short introduction about my project, clear things up and ask my question.
I use R now, with EBImage library. After that I will write that code on C++.
Image is taken from: https://de.wikipedia.org/wiki/Perlit_(Stahl)
The segmentation will be done in this image horizontally. But there would be an image with gradiental line spacings.
There seems to be a horizontal pattern in the structure.. is it always like this? Have you tried exploiting this correlation? Maybe extract vertical histogram (histogram over rows of pixels), and find maximas?
I reread your question, already saw that you are taking into account the horizontality. Knowing this, if you just want to paint the red regions, then you already have a good binary mask to paint them.. or you dont want to paint the small white patches between the dark structure?