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(); }
用户评论
么用过,不知道咋样
误删,再下载一遍
用于ocr识别,凑凑合合
用于OCR识别是可以用的
好东西 最后就用了这个
很好的库,字库训练之后识别率还是挺高的
能用,但在项目用了识别精度还不如3.01版的。
还可以吧,就是不太会用
勉强可以用于OCR识别学习,
可以使用,不错~