We'll change the previous example to work with Tesseract. Start by adding tesseract/baseapi.h and fstream to the include list:
#include opencv2/opencv.hpp; #include tesseract/baseapi.h; #include vector; #include fstream;
Then, we'll create a global TessBaseAPI object that represents our Tesseract OCR engine:
tesseract::TessBaseAPI ocr;
Next, we will create a function called ...