Image precprocessing before providing it to Tesseract

113 views
Skip to first unread message

Kshitiz Mohini

unread,
May 23, 2017, 8:24:49 AM5/23/17
to tesseract-ocr



want to remove image rectangular border before providing it to Tesseract.How can we achieve this?
Actual Image:


Required Image:




Ciaran McCormack

unread,
Jun 6, 2017, 12:20:12 PM6/6/17
to tesseract-ocr
You'll probably have to use something like OpenCV.
Generate a histogram of the image to find the most common color.
Find contours and limit it to contours with 4 sides (i.e. rectangles)
Color in the contour with the calculated color.

However an easier approach, instead of coloring in the rect might be to, again using OpenCV:
Find 4 sided contours
Perspective correct the internals of the contour so that the text is de-skewed
Process this region of the image


Reply all
Reply to author
Forward
0 new messages