How to separate overlapping contours

Can anyone tell me if it is possible and how to separate overlapping contours? I have printed text with overlapping handwritten text. I would like to extract just the printed text.

Thank you

overlapping contours cannot happen as a result of OpenCV APIs that calculate contours from a mask.

always: MRE please. present your situation.

1 Like

this will be terribly difficult.
(just try to isolate the 2 strokes of an ‘X’ …)
if someone is trying to assign this to you as some ‘side-job’ – RUN !

My use case is that I am trying to read the MICR line at the bottom of a bank check (with the routing/account number, etc) when the signature overlaps the MICR line. For example, in the following check

I can of course crop the MICR line, but is there a way to remove the signature overlap of the MICR characters without destroying the MICR line itself?

Thank you

you shouldn’t want to do that.

OCR is supposed to tolerate such occlusion.

if it can’t, it sucks and you should look for better OCR.

Any recommendations on which OCR to use? I have been using tesseract but it still fails pretty often on signature overlap

I haven’t examined any OCR packages thoroughly. I know tesseract is popular but dumb.

you need something that does not extract connected components first. that is where “traditional” OCR will fail.

it needs to apply convolutional layers directly to the input.

be prepared to finetune/train any OCR package you’ll find.

I commonly hear about “EasyOCR” and “PaddleOCR”.