karolzak / boxdetect

BoxDetect is a Python package based on OpenCV which allows you to easily detect rectangular shapes like character or checkbox boxes on scanned forms.
MIT License
104 stars 20 forks source link

Check box mapping with text #16

Open Chetan8000 opened 3 years ago

Chetan8000 commented 3 years ago

Is there any way to mapping of word or text with the checkbox, which check-box relate to which text,

mapping

City : NEWTON Pin code : 07860

karolzak commented 3 years ago

Well there's no out of the box way to do it, but you should be able to use BoxDetect to search for boxes and combine that with results from some OCR tool like Tesseract and just set some rules/logic, like: for every given check box/text box detected with BoxDetect, take it's coordinates and search through OCR results to find the nearest text detected on the left hand side of that check box/text box