tess-two-3.02-so-libs
----基于google tesseract-ocr-3.02版本;2012-12; ----Linux环境编译, 2014-12-01。 直接导入jar包,并把libs目录拷进项目即可使用。 ocr识别库下载 地址:: https://code.google.com/p/tesseract-ocr/downloads/list 调用示例程序: public void testGetUTF8Text() { // First, make sure the eng.traineddata file exists. final String inputText = "hello"; final Bitmap bmp = getTextImage(inputText, 640, 480); // Attempt to initialize the API. final TessBaseAPI baseApi = new TessBaseAPI(); baseApi.init(TESSBASE_PATH, DEFAULT_LANGUA GE); baseApi.setPageSegMode(TessBaseAPI.PageSegMode.PSM_SINGLE_LINE); baseApi.setImage(bmp); // Ensure that the result is correct. final String outputText = baseApi.getUTF8Text(); assertEquals("\"" + outputText + "\" != \"" + inputText + "\"", inputText, outputText); // Ensure that getHOCRText() produced a result. final String hOcr = baseApi.getHOCRText(0); assertNotNull("HOCR result found", hOcr); // Ensure getRegions() works. final Pixa regions = baseApi.getRegions(); assertEquals("Found one region", regions.size(), 1); // Ensure getWords() works. final Pixa words = baseApi.getWords(); assertEquals("Found one word", words.size(), 1); // Iterate through the results. final ResultIterator iterator = baseApi.getResultIterator(); String lastUTF8Text; float lastConfidence; int[] lastBoundingBox; int count = 0; iterator.begin(); do { lastUTF8Text = iterator.getUTF8Text(PageIteratorLevel.RIL_WORD); lastConfidence = iterator.confidence(PageIteratorLevel.RIL_WORD); lastBoundingBox = iterator.getBoundingBox(PageIteratorLevel.RIL_WORD); count++; } while (iterator.next(PageIteratorLevel.RIL_WORD)); // Attempt to shut down the API. baseApi.end(); bmp.recycle(); } GE); baseApi.setPageSegMode(TessBaseAPI.PageSegMode.PSM_SINGLE_LINE); baseApi.setImage(bmp); // Ensure that the result is correct. final String outputText = baseApi.getUTF8Text(); assertEquals("\"" + outputText + "\" != \"" + inputText + "\"", inputText, outputText); // Ensure that getHOCRText() produced a result. final String hOcr = baseApi.getHOCRText(0); assertNotNull("HOCR result found", hOcr); // Ensure getRegions() works. final Pixa regions = baseApi.getRegions(); assertEquals("Found one region", regions.size(), 1); // Ensure getWords() works. final Pixa words = baseApi.getWords(); assertEquals("Found one word", words.size(), 1); // Iterate through the results. final ResultIterator iterator = baseApi.getResultIterator(); String lastUTF8Text; float lastConfidence; int[] lastBoundingBox; int count = 0; iterator.begin(); do { lastUTF8Text = iterator.getUTF8Text(PageIteratorLevel.RIL_WORD); lastConfidence = iterator.confidence(PageIteratorLevel.RIL_WORD); lastBoundingBox = iterator.getBoundingBox(PageIteratorLevel.RIL_WORD); count++; } while (iterator.next(PageIteratorLevel.RIL_WORD)); // Attempt to shut down the API. baseApi.end(); bmp.recycle(); }
文件列表
tess-two-3.02-so-libs.rar
(预估有个6文件)
tess-two-3.02-so-libs
libs
armeabi-v7a
libtess.so
1.85MB
liblept.so
1.18MB
armeabi
libtess.so
1.89MB
liblept.so
1.19MB
tess-two.tesseract3.02-leptonica1.68-LibJPEG6b.jar
28KB
README
2KB
用户评论