【问题标题】:Getting Text Orientation on Tesseract - Python API在 Tesseract 上获取文本方向 - Python API
【发布时间】:2014-10-01 17:21:47
【问题描述】:

我正在使用 Tesseract Python Wrapper 来获取文本图像的方向。当我使用 Tesseract-OCR(不是 API)时,将模式设置为 -psm 0 有效,但我不知道如何在使用包装器时提取该信息。 我看过文档,我尝试使用方法 AnalyseLayout,但我似乎没有找到正确的方法。有什么想法吗??

谢谢!

【问题讨论】:

  • 嗨,你能做到吗?怎么做到的?谢谢。

标签: python tesseract


【解决方案1】:

以下是如何在 Java 中执行此操作。我想 Python 应该是类似的。

    IntBuffer orientation = IntBuffer.allocate(1);
    IntBuffer direction = IntBuffer.allocate(1);
    IntBuffer order = IntBuffer.allocate(1);
    FloatBuffer deskew_angle = FloatBuffer.allocate(1);
    int success = api.TessBaseAPIRecognize(handle, null);
    if (success == 0) {
        TessAPI.TessPageIterator pi = api.TessBaseAPIAnalyseLayout(handle);
        api.TessPageIteratorOrientation(pi, orientation, direction, order, deskew_angle);
    }

【讨论】:

  • 我尝试在 Python 中做到这一点,但我无法很好地定义方法 Orientation 的参数。还是谢谢!
猜你喜欢
  • 1970-01-01
  • 2016-12-05
  • 2016-05-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-08-27
  • 1970-01-01
相关资源
最近更新 更多