// Low-level function to recognize the current global image to a string. char* TessBaseAPI::RecognizeToString() { BLOCK_LIST block_list; FindLines(&block_list); // Now run the main recognition. PAGE_RES* page_res = Recognize(&block_list, NULL); return TesseractToText(page_res); }
// Init the page segmenter bool CubeLineSegmenter::Init() { if (init_ == true) { return true; } if (orig_img_ == NULL) { return false; } // call the internal line segmentation return FindLines(); }
char* TessBaseAPI::TesseractRectUNLV(const unsigned char* imagedata, int bytes_per_pixel, int bytes_per_line, int left, int top, int width, int height) { if (width < kMinRectSize || height < kMinRectSize) return NULL; // Nothing worth doing. // Copy/Threshold the image to the tesseract global page_image. CopyImageToTesseract(imagedata, bytes_per_pixel, bytes_per_line, left, top, width, height); BLOCK_LIST block_list; FindLines(&block_list); // Now run the main recognition. PAGE_RES* page_res = Recognize(&block_list, NULL); return TesseractToUNLV(page_res); }
// Find lines from the image making the BLOCK_LIST. BLOCK_LIST* TessBaseAPI::FindLinesCreateBlockList() { BLOCK_LIST *block_list = new BLOCK_LIST(); FindLines(block_list); return block_list; }