I have a document (graphical plan of a building) which has some objects I need to detect with text in it. Basically it's just a oblate hexagon with text inside. My task is to find all such hexagons on a given plan. I decided to cut one hexagon and set it as a template and use cv2.templateMatch. It was able to correctly detect some hexagons, but not all of them. I suppose, the problem is the text inside, since it's different for each hexagon, I'm not able to detect all the hexagons that are present.
Is it possible to somehow make the template dynamic or to detect only the surrounding borders, ignoring the text inside.
UPD: Objects I need to locate look kind of this:
__________
<|ABC12345|>
----------