/*
  Reader.h
  
  Author: Sergi Diaz Planas (2017)
*/
#ifndef READER_H
#define READER_H

/* The purpose of the Reader class is to read textual information
 * contained in Image objects. It uses tesseract OCR engine to
 * perform this task.
 *
 * */

#include "tesseract/baseapi.h"
#include "leptonica/allheaders.h"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/imgproc.hpp"
#include "Image.h"

using namespace cv;

class Reader
{
public:
    Reader();
    void setLocalDataPath(std::string localDataPath);
    std::string read(Image image);
    std::string getDni(Image image);

private:
    Mat preprocess(Mat image);
    Pix *mat8ToPix(Mat mat8);

    std::string _localDataPath;
};

#endif // READER_H
