Enough theory. It's time to see how the text module works in practice. Let's study how we can use it to perform text detection, extraction, and identification.
Using the text API
Text detection
Let's start by creating a simple program so that we can perform text segmentation using ERFilters. In this program, we will use the trained classifiers from text API samples. You may download this from the OpenCV repository, but they are also available in this book's companion code.
First, we start by including all of the necessary libs and usings:
#include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/text.hpp" #include <vector> #include <...