Image Processing for OCR

Before feeding an image to an OCR system, various image processing techniques are applied to improve text visibility and minimize noise or distortions. The basic steps are as follows: 1. Image Acquisition This is the first step, where the image is captured from a source like a scanner, camera, or downloaded from a file. The image could be in various formats such as JPG, PNG, TIFF, etc. 2. Preprocessing The goal of preprocessing is to prepare the image to make it easier for the OCR engine to read the text. Common preprocessing steps include: ...

October 22, 2024 · 2 min · Lin Lin Hlaing

Image Processing Libraries

OpenCV → mainly used in TensorFlow Purpose: Computer vision and image processing. Features: Real-time operations, image transformations, filtering, object detection, edge detection. Installation: pip install opencv-python Pillow (PIL) → PyTorch Purpose: Image manipulation. Features: Open, save, and process many image file formats; resizing, cropping, and rotating images. Installation: pip install Pillow from glob import glob vs import glob from glob import glob: Imports only the glob() function, so you can call it directly as glob(). import glob: Imports the whole glob module, so you need to call the function as glob.glob(). matplotlib.pyplot vs matplotlib.pylab matplotlib.pyplot: Preferred for most plotting tasks; provides a clean, modular interface for creating and customizing plots. matplotlib.pylab: Combines plotting with numerical operations; less commonly used due to its less modular approach and potential for namespace conflicts.

October 22, 2024 · 1 min · Lin Lin Hlaing