- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有这张图片。我正在尝试对该图像中的字母进行OCR。对于字母“9”和“R”,我没有得到期望的结果。首先,我裁剪了这两个字母和并执行以下命令。
tesseract 9.png stdout -psm 8
.
它只是返回“。”
最佳答案
我自己没有tesseract的经验,但根据google结果,复制了角色并在内部使用tesseract的https://www.newocr.com/
上添加了一些背景作品。
所以我用它作为输入:
这会在该网络应用上给出正确的结果:99999999
,而单个字符不起作用。也许您可以使用tesseract实现来验证这一点,也许它可以帮助您调整孤立的提取字符以与tesseract一起使用。例如尝试将相邻提取的轮廓重复缝合在一起,以改善tesseract的输出-因为您知道将轮廓缝合在一起的频率,所以您会知道,如果识别出相同的字符,那么输出可能是正确的。 ..
同样的作品
边框看起来很重要,如果边框不足,它将无法识别P
。一般来说,您应该尝试用纯黑色和纯白色替换背景和前景!不确定网络应用使用哪种预处理...
该代码可用于使用C++和OpenCV重复图像,但不会在周围添加边框。为此,您将非常相似地工作,但是需要执行一些附加步骤,并且必须为边框分配一些颜色。
编辑:我已更新代码,以在每个方向上使用4像素的边框(您可以调整变量),并使用黑色背景色。
这段代码非常简单,对于java,python等中的opencv应该非常相似。
int main(int argc, char * argv[])
{
//cv::Mat input = cv::imread("../inputData/ocrR.png");
if(argc != 3)
{
std::cout << "usage: .exe filename #Repetitions" << std::endl;
return 0;
}
std::string filename = argv[1];
int nRepetitions = atoi(argv[2]);
cv::Mat inputImage = cv::imread(filename);
if(inputImage.empty())
{
std::cout << "image file " << filename << " could not be loaded" << std::endl;
return 0;
}
// you instead should try to extract the background color from the image (e.g. from the image border)
cv::Scalar backgroundColor(0,0,0);
// size of the border in each direction
int border = 4;
cv::Mat repeatedImage = cv::Mat(inputImage.rows + 2*border, nRepetitions*inputImage.cols + 2*border, inputImage.type() , backgroundColor);
cv::Rect roi = cv::Rect(border,border,inputImage.cols, inputImage.rows);
for(int i=0; i<nRepetitions; ++i)
{
// copy original image to subimage of repeated image
inputImage.copyTo(repeatedImage(roi));
// update roi position
roi.x += roi.width;
}
// now here you could send your repeated image to tesseract library and test whether nRepetitions times a letter was found.
cv::imwrite("repeatedImage.png", repeatedImage);
cv::imshow("repeated image" , repeatedImage);
cv::waitKey(0);
return 0;
}
关于opencv - OCR:未获得理想的结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34176517/
根据 Wikipedia 的说法,“拉丁文打字文本的准确识别现在被认为在很大程度上解决了可以提供清晰成像的应用程序(例如扫描打印文档)的问题。”但是,它没有给出引用。 我的问题是:这是真的吗?当前最先
我在将包含文本图像的 JPG 文件转换为文本文件时遇到问题。我尝试了 ABBYY 的 OCR SDK 和其他一些 OCR 来源,但没有一个包含格鲁吉亚语。 你能告诉我是否有任何可用于格鲁吉亚语的 OC
有人给了我一大堆惊人的信息。它是 200MB 的 .tiff 扫描公告图像,可以追溯到 40 年代。我想将其数字化,但我对 OCR 一无所知。一些早期的 Material 几乎无法被人类阅读,更不用说
我正在尝试通过 python-tesseract 使用 tesseract-OCR 来读取看起来像这样的低分辨率字体: 不幸的是,该图像返回 ZIJZHZI 我认为分辨率太低,这会导致问题。我试过放大
OCR 软件是否能够可靠地将如下图像转换为值列表? 更新: 更详细的任务如下: 我们有一个客户端应用程序,用户可以在其中打开报告。此报告包含一个值表。 但并不是每个报告看起来都一样——不同的字体、不同
我正在尝试使用 Tesseract-OCR检测其中包含纯文本的图像文本,但这些文本具有名为Journal 的手写字体。 例子: 结果不是最好的: Maxima! size` W (35) 有没有可能改
我已经开始了一个简单的项目,它必须获得一个包含带有上标的文本的图像,然后通过使用 OCR(目前我正在使用 tesseract)它必须识别上标字符 + 正常字符。 例如,我们有一个化学方程式,例如 Cl
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 8年前关闭。 Improve this q
我目前正在研究 OCR(波斯语), 尽管“fas.traineddata”在tessdata中可用,但是当我使用以下命令时,什么也没发生: import pytesseract from PIL im
我对文本片段中下标和上标的一般识别有疑问。 示例图片: 我使用 Tesseract 4.1.1 和 https://github.com/tesseract-ocr/tessdata_best 下可用
在过去的 3 个月里,我一直在尝试训练 Tesseract 通过识别我拥有的图像集合,由于真正的缺乏 正确的文档,以及非常高的复杂性,我开始 放弃将 Tesseract 作为解决方案。 我正在寻找一种
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 想改进这个问题?将问题更新为 on-topic对于堆栈溢出。 12 个月前关闭。 Improve this
已结束。此问题正在寻求书籍、工具、软件库等的推荐。它不满足Stack Overflow guidelines 。目前不接受答案。 我们不允许提出寻求书籍、工具、软件库等推荐的问题。您可以编辑问题,以便
下面是我的电表读数 52425.5(粗略)的图片: 什么程序/技术可以帮助我自动抄表?备注: 这是较为清晰的图像之一。许多图像都有静态。我可以忽略(让程序说“错误”)带有太多静态的图片。 相机有一个固
大写字母OCR(光学字符识别)的常见错误有哪些? 例如FOR -> FOB 最佳答案 要获得最准确的答案,最好使用针对您的问题的特定数据样本自行测试。不同字符/单词组合的错误率可能有很大差异,具体取决
对于我想教 Tesseract 将复选框识别为单词的客户。当 Tesseract 应该识别一个空的复选框时,它工作得很好。 此命令与 this 结合使用教程就像一个魅力,Tesseract 能够找到空
我正在使用 Tesseract OCR将扫描的 PDF 转换为纯文本。总体而言,它非常有效,但我对扫描文本的顺序有疑问。带有表格数据的文档似乎是逐列向下扫描,而更自然的方式是逐行扫描。一个非常小的例子
在哪里可以找到 cube 的 tesseract ocr 土耳其语扩展模式? 文件: tr.cube.fold tr.cube.lm tr.cube.nn tr.cube.params tr.cube
我正在编写一个用于训练 Tesseract OCR 图像的生成器。 在为 Tesseract OCR 的新字体生成训练图像时,最佳值是什么: 新闻部 以磅为单位的字体大小 字体是否应该抗锯齿 边界框是
我的文本带有一些不那么复杂的数学符号,如下所示。 Tesseract OCR 默认无法识别此类数学符号(+-、角度)。我如何通过 tesseract 识别这些数学符号? 最佳答案 只需使用以下语句:
我是一名优秀的程序员,十分优秀!