502 B
502 B
Image Pre-processing
- Invert image - Tesseract 3.0 only?
- Rescale
- Binarize
- Remove noise
- Dilation and erosion
- Rotation and deskewing
- Remove borders
- Missing borders
- Transparency and alpha channel
Invert Image
inverted_image = cv2.bitwise_not(image)
cv2.imwrite('tmp/inverted_image.jpg', inverted_image)
Rescale
Binarize
- Grayscale image first.
- Convert to black and white.
- Adjust threshold values, may require testing.