I am trying to extract handwritten text from images. I use python with opencv functions such us find_contours. It was all going pretty well when I used images like this one:
It works fine because I have a plain background. But then I tested it with this image:
Because of the notebook's lines in the background, I am not able to extract the text only. Although the text is red, I turn all images to grayscale or sometimes threshold so it all turns black just like the notebook lines. That way the colour of the text does not matter. So my question here is: could anyone please give me advice or a possible solution on how to deal with this kind of background in order to extract the text. I really don't want to use the sliding window method. Thank you in advance