I wrote program to recognize music notation (exactly tabulature). In the main there are digits on the lines. After preprocessing (global binarization) I remove lines. I'd like to ask about preprocessing. My program works fine where lines and digits have the same color. But lines are often lighter than digits. When I use binarization with small threshold lines disapear when I use binarization with bigger threshold there are too many noises and digits are thick.
What kind of binarization (in OpenCV) can you recommend? What to do? Is there any solution for this problem?
I'll add some example.
My preprocessing looks like that:
1) Reading image in gray colors:
2) GLobal binarization:
cv::threshold (for example 127)
Characters are not beautiful... :( But main problem is that lines disappeared.
3) cv::threshold (230)
I can see lines but charackters are thick and ugly. For example 'a' character sometimes does not have empty space in the middle and so on. And there are a lot of noises. :(
And there is one more problem... I have to set threshold value for every file....
Do you have any suggestion for preprocesssing???
I'd like to have "nice" lines and characters...
(I don't ask about code, just some suggestions and advices)