Modular image processing pipeline using OpenCV and Python generators
Published in
7 min readOct 21, 2019
In this blog story, you will learn how to implement a simple and modular pipeline for image processing. We will use OpenCV for image processing and manipulation and Python generators for the steps of the pipeline.
An image processing pipeline is a set of tasks executed in a predefined sequence order to transform the image into the desired result or extract some interesting features.
Task examples could be:
- image transformations like translation, rotation, resizing, flipping and cropping,
- enhancement of the image,
- extraction of the region of interest (ROI),
- computing feature descriptors,
- image or object classification,
- object detection,
- image annotations for machine learning,
and many more.
The final result could be a new image or just a JSON file containing some information about the image.
Let’s assume that you have a load of images in a directory and want to detect faces on them and write each face to a…