Bade
Bade

Reputation: 747

How to remove rectangle shapes from image, keeping text, in Python3?

I am trying to extract the text from flowcharts and decision trees. If I use the image with original boxes/shapes, the text region detection is poor. Is there any way to remove these shapes (keeping the text)?

enter image description here

Upvotes: 4

Views: 766

Answers (1)

fireant
fireant

Reputation: 14530

You could use connectedComponentsWithStats(), you will have single component for the chart lines, then just remove that component from the image.

Upvotes: 1

Related Questions