1. 首页
  2. 移动开发
  3. Android
  4. tess-two-3.02-so-libs

tess-two-3.02-so-libs

上传者: 2018-12-28 14:48:44上传 RAR文件 2.95MB 热度 34次
----基于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(); }
用户评论
码姐姐匿名网友 2018-12-28 14:48:44

么用过,不知道咋样

码姐姐匿名网友 2018-12-28 14:48:44

误删,再下载一遍

码姐姐匿名网友 2018-12-28 14:48:44

用于ocr识别,凑凑合合

码姐姐匿名网友 2018-12-28 14:48:44

用于OCR识别是可以用的

码姐姐匿名网友 2018-12-28 14:48:44

好东西 最后就用了这个

码姐姐匿名网友 2018-12-28 14:48:44

很好的库,字库训练之后识别率还是挺高的

码姐姐匿名网友 2018-12-28 14:48:44

能用,但在项目用了识别精度还不如3.01版的。

码姐姐匿名网友 2018-12-28 14:48:44

还可以吧,就是不太会用

码姐姐匿名网友 2018-12-28 14:48:44

勉强可以用于OCR识别学习,

码姐姐匿名网友 2018-12-28 14:48:44

可以使用,不错~