Python HOW: Image processing for OCR using OpenCV
Prepare your images for Optical Character Recognition APIs
If your image has random noise, uneven illumination, holes in front objects, etc. There are few things that you can do before posting your image to a computer vision API. In this article, we go through few processing techniques to boost OCR results using OpenCV
Install OpenCV
Install OpenCV using your preferred package manager
Read the image
I will use the cover of the 1st edition of one of my favorite books as an example. Let’s first read the image, specifying the colour type of the image to coloured. This will read the image in the default colour format in OpenCV which is BGR (Blue-Green-Red). We will then convert the colour space to the more common RGB order (and for…