ScreenTranslator/Recognizer.h

40 lines
678 B
C
Raw Normal View History

#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-09-23 01:41:08 +07:00
class Recognizer : public QObject {
Q_OBJECT
public:
2015-09-23 01:41:08 +07:00
explicit Recognizer (QObject *parent = 0);
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);
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_;
2013-11-24 19:43:37 +07:00
QString tessDataDir_;
QString ocrLanguage_;
int imageScale_;
};
#endif // RECOGNIZER_H