38 lines
1.0 KiB
C++
38 lines
1.0 KiB
C++
|
#ifndef __HGOCRTESSERACT_HPP__
|
||
|
#define __HGOCRTESSERACT_HPP__
|
||
|
|
||
|
#include "HGOCRBase.hpp"
|
||
|
#include "../base/HGDef.h"
|
||
|
#include "../base/HGInc.h"
|
||
|
#include "../base/HGImage.h"
|
||
|
#include "../base/HGDll.h"
|
||
|
#include "../imgfmt/HGTiff.h"
|
||
|
#include "tesseract/capi.h"
|
||
|
#include <vector>
|
||
|
#include <string>
|
||
|
|
||
|
class HGOCRTesseract : public HGOCRBase
|
||
|
{
|
||
|
public:
|
||
|
HGOCRTesseract();
|
||
|
virtual ~HGOCRTesseract();
|
||
|
|
||
|
HGResult Init();
|
||
|
HGResult Deinit();
|
||
|
HGResult ImageOCR(HGImage image, class HGOCRRetImpl** ocrRet);
|
||
|
HGResult ImageOCRToFile(HGImage image, HGUInt outType, const HGChar* outFileName);
|
||
|
HGResult ImageTextDirectOCR(HGImage image, HGUInt* direct);
|
||
|
HGResult AddToImageList(HGImage image);
|
||
|
HGResult ClearImageList();
|
||
|
HGResult ImageListOCRToFile(HGUInt outType, const HGChar* outFileName, HGImageListOcrFunc func, HGPointer param);
|
||
|
|
||
|
private:
|
||
|
HGResult OCRToFile(const HGChar *inFileName, HGUInt outType, const HGChar* outFileName);
|
||
|
|
||
|
private:
|
||
|
TessBaseAPI* m_baseApi;
|
||
|
std::string m_tiffFileName;
|
||
|
HGTiffWriter m_tiffWriter;
|
||
|
};
|
||
|
|
||
|
#endif /* __HGOCRTESSERACT_HPP__ */
|