- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们希望开发应用程序来从图像中提取文本以及提取和求解数学方程式使用 Tesseract OCR 引擎实现从图像中提取文本但是当我们试图从图像中提取方程式时,结果却令人失望我们一直在使用 3.01 版本 我们预计这是问题的原因所以我们构建了位于存储库中的最新版本的 Tesseract https://github.com/rmtheis/tess-two我们使用官方训练的数据文件eng.traineddata 检测文本,这很好用,equ.traineddata 检测数学符号和数学方程式,但没有给出预期的结果。
如有任何帮助,我们将不胜感激。谢谢。
protected String onPhotoTaken()
{
// lang.traineddata file with the app (in assets folder)
// You can get them at:
// http://code.google.com/p/tesseract-ocr/downloads/list
// This area needs work and optimization
boIsTaken = true;
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 4;
Bitmap bitmap = BitmapFactory.decodeFile(strTakenPicPath, options);
try {
ExifInterface exif = new ExifInterface(strTakenPicPath);
int exifOrientation = exif.getAttributeInt(
ExifInterface.TAG_ORIENTATION,
ExifInterface.ORIENTATION_NORMAL);
Log.v(TAG, "Orient: " + exifOrientation);
int rotate = 0;
switch (exifOrientation) {
case ExifInterface.ORIENTATION_ROTATE_90:
rotate = 90;
break;
case ExifInterface.ORIENTATION_ROTATE_180:
rotate = 180;
break;
case ExifInterface.ORIENTATION_ROTATE_270:
rotate = 270;
break;
}
Log.v(TAG, "Rotation: " + rotate);
if (rotate != 0) {
// Getting width & height of the given image.
int w = bitmap.getWidth();
int h = bitmap.getHeight();
// Setting pre rotate
Matrix mtx = new Matrix();
mtx.preRotate(rotate);
// Rotating Bitmap
bitmap = Bitmap.createBitmap(bitmap, 0, 0, w, h, mtx, false);
}
// Convert to ARGB_8888, required by tess
bitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true);
} catch (IOException e) {
Log.e(TAG, "Couldn't correct orientation: " + e.toString());
}
// _image.setImageBitmap( bitmap );
Log.v(TAG, "Before baseApi");
TessBaseAPI baseApi = new TessBaseAPI();
Log.v(TAG, "initialize baseApi");
baseApi.setDebug(true);
//getLang() returns equ in case of equations detection
baseApi.init(DATA_PATH, getLang());
Log.v(TAG, "init baseApi done");
baseApi.setImage(bitmap);
String recognizedText = baseApi.getUTF8Text();
baseApi.end();
// You now have the text in recognizedText var, you can do anything with it.
// We will display a stripped out trimmed alpha-numeric version of it (if lang is eng)
// so that garbage doesn't make it to the display.
Log.v(TAG, "Detected TEXT: " + recognizedText);
if ( getLang().equalsIgnoreCase("eng") ) {
recognizedText = recognizedText.replaceAll("[^a-zA-Z0-9]+", " ");
}
recognizedText = recognizedText.trim();
return recognizedText;
// Cycle done.
}//end onPhotoTaken
最佳答案
那是因为 equ.traineddata 是******,我使用 eng.traineddata 进行数字识别。也许我们需要训练自己的 .traineddata 来检测数学方程式:S
如果您找到任何比 equ 更好的数学 .traineddata,请告诉我
关于android - 为什么 Tesseract for Android 在使用 "equ.traineddata"检测数学符号或方程时返回乱码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29527857/
我希望 tesseract 引擎使用 eq.traineddata研究一些数学以及孟加拉语、印地语文本。当我去 /usr/share/tesseract-ocr/4.00/tessdata ,我只看到
我是 Tess4J 的新人。我收到此错误 打开数据文件./tessdata/eng.traineddata时出错请确保 TESSDATA_PREFIX 环境变量设置为“tessdata”目录的父目录。
安装了 Tesseract 以使用 Selenium WebDriver (Java) 进行一些 OCR 测试。 这是我对 Tess4J 的 Maven 依赖 net.sourceforge.tes
安装了 Tesseract 以使用 Selenium WebDriver (Java) 进行一些 OCR 测试。 这是我对 Tess4J 的 Maven 依赖 net.sourceforge.tes
我正在使用 Tess4j 和 java,并且我需要一次访问多个 .traineddata 文件。我已经训练了 tesseract 来创建我自己的 .traineddata 文件,并将它们与 Tess4
我在 Tomcat 9 中的 Web 应用程序中遇到了这个问题: 打开数据文件时出错 ./tessdata/eng.traineddata请确保将 TESSDATAPREFIX 环境变量设置为“tes
据我所知,Tesseract 3.x 带有 6 种英文(如果我错了请纠正我)字体。我需要为更多 5 种字体训练 Tesseract。我只需要大写字母和数字(没有特殊字符或符号)。 我遵循了各种流程,例
我正在尝试从简单图像中提取文本。 当我使用默认引擎 (oem 3) 时,文本被提取(很差)。我想使用其他引擎 (oem 2) 看看输出是否可以提高。 import pytesseract #this
我们希望开发应用程序来从图像中提取文本以及提取和求解数学方程式使用 Tesseract OCR 引擎实现从图像中提取文本但是当我们试图从图像中提取方程式时,结果却令人失望我们一直在使用 3.01 版本
我正在使用 openCV 和 Tesseract 框架开发一个应用程序。它在“不支持 64 位”的情况下运行良好,但苹果现在要求在每个版本中都支持 64 位。所以我已经将 tesseract 框架更新
我目前正在尝试将 Tesseract OCR 实现到我的项目中,但已经走到了十字路口。我遵循了 https://github.com/rmtheis/tess-two 中的所有指示并陷入了该项目的实际
我遇到了这个错误,这个错误让我对 tesseract 的 python 包装器感到有点疯狂,这是一个名为 tesseract 的 python 模块。 这是我尝试运行的 python 代码: img
我是一名优秀的程序员,十分优秀!