【问题标题】:tesseractjs misbehaving on a series of same type imagestesseract js 在一系列相同类型的图像上行为不端
【发布时间】:2023-03-28 04:20:01
【问题描述】:

我有一系列尺寸相同、格式相同、配色方案相同的图像,并且它们都具有相同的文本格式。我想使用 tesseractjs 来返回他们的文本,但是 tesseract 对他们的工作并不相同。在某些图像上,它会在其他图像上返回文本,而不会。这是我的 tesseract 代码:

import { createWorker } from "tesseract.js";

const worker = createWorker();

(async () => {
  await worker.load();
  await worker.loadLanguage("eng");
  await worker.initialize("eng");
  const {
    data: { text }
  } = await worker.recognize("image.png");
  console.log(text);
  await worker.terminate();
})();

代码来源:tesseract.js github

【问题讨论】:

    标签: javascript node.js tesseract.js


    【解决方案1】:

    似乎图像有一定程度的噪音,而它们看起来很清晰易读,其中一些噪音水平较高,导致 tesseract 失败,因此需要进行预处理才能获得良好的结果。

    【讨论】:

      猜你喜欢
      • 2015-03-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-18
      • 1970-01-01
      • 1970-01-01
      • 2016-08-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多