提交 46123802 编写于 作者: T tmbdev

added potential new APIs for communicating page segmentation information and...

added potential new APIs for communicating page segmentation information and performing line recognition with baseline data; Ray will think about implementing these

git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@122 d0cd1f9f-072b-0410-8dd7-cf729c803f20
上级 58ade5fc
......@@ -214,6 +214,39 @@ class TessBaseAPI {
int** x1,
int** y1,
PAGE_RES* page_res);
// If you call this before recognizing a page, Tesseract will use the color
// page segmentation data to guide its segmentation process. If you call
// it with a null pointer, Tesseract will revert to internal layout analysis
// (i.e., single column line finding). The segdata pointer is shared with
// Tesseract until SetPageSegmentation is called with a new pointer (i.e.,
// Tesseract doesn't make its own internal copy). This image must have the
// same width and height as any image being recognized while this segmentation
// is in effect.
// The segdata values are RGB triples, with distinct R values denoting distinct
// "blocks" or "columns" and distinct GB pairs denoting distinct lines.
// Lexicographic ordering of the RGB triples corresponds to text output order, with
// linebreaks inserted between distinct GB values and double blank lines between
// distinct R values.
static int SetPageSegmentation(const unsigned char *segdata,
int bytes_per_pixel, /* must be 3 */
int top, int left, int width, int height);
// New calling interface into Tesseract that permits baseline data to be passed.
// The input to this should be a single line of text.
static int TesseractWithBaseline(const unsigned char* imagedata,
int bytes_per_pixel,
int width, int height,
int *baseline_ypos,
int *xheight_ypos,
char** string,
int** lengths,
float** costs,
int** x0,
int** y0,
int** x1,
int** y1,
PAGE_RES* page_res);
};
#endif // THIRD_PARTY_TESSERACT_CCMAIN_BASEAPI_H__
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册