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 <iostream> using namespace std; using namespace cv; using namespace cv::text;
Recall from the Extremal region filtering section that the ERFilter works separately in each image channel. Therefore, we must provide a way to separate each desired channel in a different ...