2013-11-23 14:00:22 +07:00
|
|
|
#ifndef RECOGNIZER_H
|
|
|
|
#define RECOGNIZER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include "QPixmap"
|
|
|
|
|
2013-11-26 13:44:00 +07:00
|
|
|
#include "ProcessingItem.h"
|
2013-11-24 19:43:37 +07:00
|
|
|
|
2015-09-23 01:41:08 +07:00
|
|
|
namespace tesseract {
|
2013-11-24 19:43:37 +07:00
|
|
|
class TessBaseAPI;
|
|
|
|
}
|
2015-10-10 17:33:18 +07:00
|
|
|
class RecognizerHelper;
|
2013-11-24 19:43:37 +07:00
|
|
|
|
2015-09-23 01:41:08 +07:00
|
|
|
class Recognizer : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2013-11-23 14:00:22 +07:00
|
|
|
public:
|
2015-09-23 01:41:08 +07:00
|
|
|
explicit Recognizer (QObject *parent = 0);
|
2013-11-23 14:00:22 +07:00
|
|
|
|
|
|
|
signals:
|
2013-11-26 13:44:00 +07:00
|
|
|
void recognized (ProcessingItem item);
|
2013-11-24 19:43:37 +07:00
|
|
|
void error (QString text);
|
2013-11-23 14:00:22 +07:00
|
|
|
|
|
|
|
public slots:
|
2013-11-26 13:44:00 +07:00
|
|
|
void recognize (ProcessingItem item);
|
2013-11-24 19:43:37 +07:00
|
|
|
void applySettings ();
|
|
|
|
|
|
|
|
private:
|
2015-09-23 01:41:08 +07:00
|
|
|
bool initEngine (tesseract::TessBaseAPI * &engine, const QString &language);
|
2013-11-24 19:43:37 +07:00
|
|
|
|
|
|
|
private:
|
2015-09-23 01:41:08 +07:00
|
|
|
tesseract::TessBaseAPI *engine_;
|
2015-10-10 17:33:18 +07:00
|
|
|
RecognizerHelper *recognizerHelper_;
|
2013-11-24 19:43:37 +07:00
|
|
|
|
|
|
|
QString tessDataDir_;
|
|
|
|
QString ocrLanguage_;
|
|
|
|
int imageScale_;
|
2013-11-23 14:00:22 +07:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RECOGNIZER_H
|