Segment image by lines

really ? what would be the next step, once you have the areas ?
this kind of “annotation” is quite destructive, no ?

sure, you can try findContours() with RETR_TREE, and have some fun with MNIST to decipher the numbers, but it all looks like a “broken plan” to me …