I followed some code to do simple text recognition (from How to detect separate figures in an image?). However, it keeps adding addition contours inside my letters like the loops in an e. The code used is:
My attempt to fix this was to test for overlapping contours from a previous iteration. But after labelling each contour I noticed that they are created from lowest y point to the highest as seen in the [output][1]
What is the easiest way to remove the inner contours? I have seen numerous threads referring to the RETR_EXTERNAL (already using) calls and hierarchies, but I don't see how they are applicable to this code.