mercredi 22 janvier 2020

How to use OpenCV to detect a checkbox that intersects a line in a document

I have successfully used code to detect checkboxes in documents, following the base case similar to:

How to detect/find checkbox contours using OpenCV

It is working well, however it fails whenever a box touches a line on one of its sides, which occurs fairly frequently in my use case. I have included two examples, one original and one is the image after being processed with canny.

Checkbox intersecting line Checkbox after canny

Is there a general method for separating two overlapping contours, or some other method I could use to detect the box that has such an overlap?




Aucun commentaire:

Enregistrer un commentaire